Sign in to follow this  
Followers 0
qwert

Input control without a border

8 posts in this topic

Is there a setting to turn off -- or set to white -- the thin default border that is placed around an input control? The create I'm using is simply:

$ctrlIn = GUICtrlCreateInput("", 20, 60, 100, 30)
But for my application, the resulting control is on a white "container" background and the extra line around the input field looks out of place. I've searched and read quite a few posts and can't get a handle on how to do this.

Thanks in advance for any help.

Share this post


Link to post
Share on other sites



Is there a setting to turn off -- or set to white -- the thin default border that is placed around an input control? The create I'm using is simply:

$ctrlIn = GUICtrlCreateInput("", 20, 60, 100, 30)
But for my application, the resulting control is on a white "container" background and the extra line around the input field looks out of place. I've searched and read quite a few posts and can't get a handle on how to do this.

Thanks in advance for any help.

Like this?

#include <GUIConstants.au3>

$gui = GUICreate("", 300, 200)
GUISetBkColor (0xFFFFFF)
$Input = GUICtrlCreateInput("Borderless Input", 10,10,190, 20, -1, $WS_EX_TOOLWINDOW)
GUISetState()


While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            ExitLoop
    EndSelect
WEnd

Share this post


Link to post
Share on other sites

Exactly like that! Thanks very much.

But how did you know to use the $WS_EX_TOOLWINDOW style when the definition of it says nothing about using it for individual controls?

Creates a tool window; that is, a window intended to be used as a floating toolbar. A tool window has a title bar that is shorter than a normal title bar, and the window title is drawn using a smaller font. A tool window does not appear in the taskbar or in the dialog box that appears when the user presses ALT+TAB. If a tool window has a system menu, its icon is not displayed on the title bar. However, you can display the system menu by typing ALT+SPACE.

Share this post


Link to post
Share on other sites

Exactly like that! Thanks very much.

But how did you know to use the $WS_EX_TOOLWINDOW style when the definition of it says nothing about using it for individual controls?

Individual controls are actually "windows" themselves. You can apply many window styles/manipulations to controls themselves.

Share this post


Link to post
Share on other sites

Individual controls are actually "windows" themselves. You can apply many window styles/manipulations to controls themselves.

Wow. That's a breakthrough in understanding for me. That simple statement needs to be "up in lights" somewhere, if it's not already (and I just missed it).

Thanks again.

Share this post


Link to post
Share on other sites

A footnote for others:

I've found that $WS_EX_TRANSPARENT is a better choice because it does not affect the behavior of other fields on the GUI.

Share this post


Link to post
Share on other sites

#7 ·  Posted (edited)

Wow. That's a breakthrough in understanding for me. That simple statement needs to be "up in lights" somewhere, if it's not already (and I just missed it).

Thanks again.

Yes, it was a eureka moment for me when I first learned about it after reading some thread in the forum some/long time ago.

A footnote for others:

I've found that $WS_EX_TRANSPARENT is a better choice because it does not affect the behavior of other fields on the GUI.

Can you clarify what you mean by "does not affect the behaviour of other fields on the GUI"?

I don't see any odd behaviour with $WS_EX_TOOLwindow... not that it's better than $WS_EX_TRANSPARENT, just curious...

Edited by ResNullius

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

Can you clarify what you mean by "does not affect the behaviour of other fields on the GUI"?

I had several buttons defined on the same GUI. With $WS_EX_TOOLWINDOW for the input style, the button clicks were no longer detected. I just changed to $WS_EX_TRANSPARENT and everything worked again, so I didn't investigate any further. It may have been due to some other simple setting or conflict that I don't know about -- but Transparent is working fine for me. Edited by qwert

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