Sign in to follow this  
Followers 0
Max Kipness

_GUICtrlRichEdit and button focus

3 posts in this topic

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

Share this post


Link to post
Share on other sites



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

try _WinAPI_SetFocus($GUIRichEdit) after your bold and italic functions. must #Include <WinAPI.au3>

Share this post


Link to post
Share on other sites

try _WinAPI_SetFocus($GUIRichEdit) after your bold and italic functions. must #Include <WinAPI.au3>

That worked beautifully. Thanks.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0