Sign in to follow this  
Followers 0
qwert

How to remove edit control's outline?

7 posts in this topic

I've used various "Set" steps to change the color of the font, the background, etc. -- but I've haven't found a way to set the line around an Edit Control to white. Better yet, I'd like to be able to set LineType=none. Is that possible?

Thanks for any assistance.

post-29172-12472672504129_thumb.png

Share this post


Link to post
Share on other sites



Edit: By the way, I think it's the WS_EX_CLIENTEDGE that needs to be removed.

Thanks for the response. I do see that by using the -1 style, there are no borders. However, my control requires only a vertical scroll bar so I define the style with:

GUICtrlCreateEdit("Test", 20, 20, 300, 200, $ES_AUTOVSCROLL + $WS_VSCROLL)

How can I construct a "take away extended style" setting -- the setting that you mentioned was controlled by WS_EX_CLIENTEDGE?

Share this post


Link to post
Share on other sites

The -1 is for default value of the function, the 0 in the extended style parameter makes the difference. Have a look at this code as for changing the extended style of already defined control. Only styles or extended styles that are changeable on the fly will reflect the changes, in other words, creating an edit control with it's style set to $ES_PASSWORD can't be changed on the fly latter on and vice versa:

#include <Constants.au3>
#include <WinAPI.au3>
#include <WindowsConstants.au3>

Global $hGUI = GUICreate('Test', 200, 200)
Global $Edit = GUICtrlCreateEdit('', 20, 20, 160, 160)
Global $hEdit = GUICtrlGetHandle(-1)
_WinAPI_SetWindowLong($hEdit, $GWL_EXSTYLE, BitAND(_WinAPI_GetWindowLong($hEdit, $GWL_EXSTYLE), BitNOT($WS_EX_CLIENTEDGE)))


GUISetState()
Do
Until GUIGetMsg() = -3

GUIDelete()
Exit

Share this post


Link to post
Share on other sites

... the 0 in the extended style parameter makes the difference.

Perfect. That was the part I didn't know. I get just the result I need by using:

GUICtrlCreateEdit("Test", 20, 20, 300, 200, $ES_AUTOVSCROLL + $WS_VSCROLL, 0)

Thanks very much for your help.

Share this post


Link to post
Share on other sites

Perfect. That was the part I didn't know. I get just the result I need by using:

GUICtrlCreateEdit("Test", 20, 20, 300, 200, $ES_AUTOVSCROLL + $WS_VSCROLL, 0)

Thanks very much for your help.

BitOr($ES_AUTOVSCROLL, $WS_VSCROLL) is better and won't produce unexpected results.


Serial port communications UDF Includes functions for binary transmission and reception.printing UDF Useful for graphs, forms, labels, reports etc.Add User Call Tips to SciTE for functions in UDFs not included with AutoIt and for your own scripts.Functions with parameters in OnEvent mode and for Hot Keys One function replaces GuiSetOnEvent, GuiCtrlSetOnEvent and HotKeySet.UDF IsConnected2 for notification of status of connected state of many urls or IPs, without slowing the script.

Share this post


Link to post
Share on other sites

BECAUSE!!!

"bitor ()" and "+"

do different things when combining GUistyle values i would trust Bitor() over + anyday

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