Max Kipness Posted July 25, 2011 Posted July 25, 2011 Hi, In an app I've created I recently I switched from GUICtrlCreateEdit to _GUICtrlRichEdit_Create so I could create bolding, italics on only certain characters in the edit screen. My problem is that I have a B and I button for bold and italic that steal focus. Previously with the standard edit control, when i hit the bold or italic buttons, the focus stayed on the edit control without me having to do anything. But now with _GUICtrlRichEdit_Create, when I click on the bold or italic buttons, those buttons steal the focus. Each of those buttons runs a separate function, but I can't figure out how to return the focus via the functions as GUICtrlSetState($edit,$GUI_FOCUS) doesn't seem to work for this control. Anyone have any ideas of how to fix this? Is there some type of set state command for richedit that I'm missing? Thanks in advance. Max
tlman12 Posted July 26, 2011 Posted July 26, 2011 Hi,In an app I've created I recently I switched from GUICtrlCreateEdit to _GUICtrlRichEdit_Create so I could create bolding, italics on only certain characters in the edit screen.My problem is that I have a B and I button for bold and italic that steal focus. Previously with the standard edit control, when i hit the bold or italic buttons, the focus stayed on the edit control without me having to do anything. But now with _GUICtrlRichEdit_Create, when I click on the bold or italic buttons, those buttons steal the focus. Each of those buttons runs a separate function, but I can't figure out how to return the focus via the functions as GUICtrlSetState($edit,$GUI_FOCUS) doesn't seem to work for this control.Anyone have any ideas of how to fix this? Is there some type of set state command for richedit that I'm missing?Thanks in advance.Maxtry _WinAPI_SetFocus($GUIRichEdit) after your bold and italic functions. must #Include <WinAPI.au3>
Max Kipness Posted July 26, 2011 Author Posted July 26, 2011 try _WinAPI_SetFocus($GUIRichEdit) after your bold and italic functions. must #Include <WinAPI.au3>That worked beautifully. Thanks.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now