This must be simple but i am loosing it somewhere...
I use this code to give focus to a editbox in a dialog after the defaultpushbutton is pressed:
what i want is that the focus returns to the edit box field after the button was pressed.
Strange things happen:
====================
-if i press Enter everything is ok, but if i press the button all actions are done ok but next time i try to enter something in the edittext field i get a "ding" sound and i cant eneter text in there anymore...
Any ideeas?
PS
====
710 is the ID of the editbox
780 is the ID of the default button "save and reenter"
I use this code to give focus to a editbox in a dialog after the defaultpushbutton is pressed:
;--------------------------------
; clear the edit text
;--------------------------------
Call SetDlgItemText,hDlg,710,offset sz_null
;---------------------------------------------
; and give him focus again
;----------------------------------------------
Call SendDlgItemMessage,hDlg,780,WM_KILLFOCUS,0,0
Call SendDlgItemMessage,hDlg,710,WM_SETFOCUS,0,0
what i want is that the focus returns to the edit box field after the button was pressed.
Strange things happen:
====================
-if i press Enter everything is ok, but if i press the button all actions are done ok but next time i try to enter something in the edittext field i get a "ding" sound and i cant eneter text in there anymore...
Any ideeas?
PS
====
710 is the ID of the editbox
780 is the ID of the default button "save and reenter"
hi BogdanOntanu,
i dont ever use dialog boxes so im not sure if you can process certain messages. have you tryed using the api SetFocus instead? ive tested your problem and can reproduce it using your method but with SetFocus it works like it should.
also if you send WM_ACTIVATE instead of WM_SETFOCUS it should work.
i dont ever use dialog boxes so im not sure if you can process certain messages. have you tryed using the api SetFocus instead? ive tested your problem and can reproduce it using your method but with SetFocus it works like it should.
also if you send WM_ACTIVATE instead of WM_SETFOCUS it should work.
Thx man!
I actually works ok like this
Cant figure out why my original code did not worked but who cares anymore?
:stupid:
I actually works ok like this
Call GetDlgItem,[hDlg],710
Call SetFocus,eax
Cant figure out why my original code did not worked but who cares anymore?
:stupid:
To continue the :stupid: series ...
is there a edittext style equivalent to C++ Auto_HSCROLL feature?
i mean cand i easy auto scroll the text in an edit box if there is more input than the box length ?
is there a edittext style equivalent to C++ Auto_HSCROLL feature?
i mean cand i easy auto scroll the text in an edit box if there is more input than the box length ?
There is ES_AUTOSCROLL
This is taken from Svin's LBClass.exe tool for style information on controls:
This is taken from Svin's LBClass.exe tool for style information on controls:
Automatically scrolls text to the right
by 10 characters when the user types
a character at the end of the line.
When the user presses the ENTER key,
the control scrolls all text back to position zero
by 10 characters when the user types
a character at the end of the line.
When the user presses the ENTER key,
the control scrolls all text back to position zero
Thx Nan
But it looks like my res compiler (aka brc32) knows nothing about ES_AUTOSCROLL :(
But it looks like my res compiler (aka brc32) knows nothing about ES_AUTOSCROLL :(
I just noticed i forgot to type the "H" in autoscroll, sorry. If your were wise enough to catch this, and still had no luck, here are their hex definitions:
ES_AUTOVSCROLL equ 40h
ES_AUTOHSCROLL equ 80h
Good Luck,
NaN
ES_AUTOVSCROLL equ 40h
ES_AUTOHSCROLL equ 80h
Good Luck,
NaN
Thx man
even if the style worked in res compiler (ie no errors reported)
it is still not working in practice... the editbox just beeps when i reach at right margin... no scrolling is done...
I guess i must handle this by hand?
even if the style worked in res compiler (ie no errors reported)
it is still not working in practice... the editbox just beeps when i reach at right margin... no scrolling is done...
I guess i must handle this by hand?
hi BogdanOntanu,
using these styles below you shouldnt have any problems with horizontal scrolling when the text exceeds the size of the editbox. using the keyboard, mouse or whatever there should be no beeping.
WS_CHILD + WS_VISIBLE + ES_AUTOHSCROLL
using these styles below you shouldnt have any problems with horizontal scrolling when the text exceeds the size of the editbox. using the keyboard, mouse or whatever there should be no beeping.
WS_CHILD + WS_VISIBLE + ES_AUTOHSCROLL
yup it works now,
thx guys
i still cant figure out why my original code did not work but since i have a good working versions now... that is it ;)
thx guys
i still cant figure out why my original code did not work but since i have a good working versions now... that is it ;)