Hi again, can't get this to work. I've tried the stylebits line before and after the textboxes were defined, but I understand it doesn't matter where stylebits is used as long as it is before the window is opened?. Clearly doing something wrong? Compiles fine but numbers still appear in the textbox as I type?
Hi Walt,thanks for your very quick assist, but I still can't get it working like I think itshould? I assume that someone types their pin in the textbox, but each character typed should appear in the textbox as a *? If that is the case, and if I can get it working, then can I read the contents that were typed in the normal way? i.e. #home.tbpw1,"!contents? temp$"
Feeling quite chuffed (UK term for being pleased with myself!). Happy with attached that I can utilise into my program, but it is not perfect - I can't get the curser to flash in the other textbox? It clearly has focus when you click into it, as text can be added. Any suggestions please, (and I won't be offended by criticism)
In case you forget to look, the target pin is 1234
pwtb1 = hWnd(#home.tbpw1) 'target textbox for entering pin - 'handle' is the Windows reference to the target textbox timer 100, [Seekpwtb1] 'check every 100mS to see if pin textbox has focus wait [Seekpwtb1] CallDLL #user32, "GetFocus", handle As long print #home.tbpw1, "!setfocus" if pwtb1 = handle then [SeekPin1] wait [SeekPin1] timer 0 timer 100, [GetPin1] wait [GetPin1] CallDLL #user32, "GetFocus", handle As long if pwtb1 <> handle then [OnePin] 'check focus remains on pin textbox #home.tbpw1 "!contents? pw1$" if len(pw1$)>3 then print #home.tbpw1, "!disable" goto [DonePin1] end if wait [DonePin1] timer 0 print #home.tb3, pw1$ if pw1$ <> pin$ then print #home.tbpw1, "" print #home.tbpw1, "!enable" notice "Wrong pin!" goto [OnePin] end if notice "Happy Days, found pin ";pw1$ timer 0 print #home.tbpw2, "!setfocus" wait
I don't know what you mean by making the textbox higher?
In this line, textbox #home.tbpw2, 110, 130,150,20 "20" is textbox height in pixels. I remember from some forum post long ago that if this space is too small, you do not have cursor in that textbox. On my machine, I do not have the cursor So try and change it to textbox #home.tbpw2, 110, 130,150,30 - it helped in my case. If you will get the cursor, that should mean that was indeed the problem (and you can make it smaller for cursor still showing)