Jump to content
Sign in to follow this  

Window Styles, Button Styles, all kindof styles

Recommended Posts


Ok, i moved the discussion from the previous topic on the GUI forum.

So where was i?

After the latest advice i browsed thru MSDN till i got scared by a 1993 article defining window styles and some other articles stating that some of the window styles are obsolete or best avoided. So i got over my window edges and frames period by ignoring it. BUT...

1.I hit the wall with a more relevant issue, the default push button. The BS_DEFPUSHBUTTON should define a default button which is pushed by pressing Enter, plus some kind of thick frame. See the code below

2.Help says that if the second button doesnt explicit its dimension, it gets the height and weight from the preceding button. which doesnt seem to happen, as proved by the same script below:

#include <GUIConstants.au3>

$gui=GUICreate("Background", 800, 300, 500, 400)
$id1=GUICtrlCreateButton("I am Default",Default,Default,100,100)
$id2=GUICtrlCreateButton("I wish i could be default",150,50,Default,Default,$bs_defpushbutton)

    $msg = GUIGetMsg()
    IF $msg=$id1 Then MsgBox(0,"","Told ya im default")
    IF $msg=$id2 Then MsgBox(0,"","Ill never be default")
until $msg = $GUI_EVENT_CLOSE

Share this post

Link to post
Share on other sites

If you use the keyword 'Default' for the height and width of the button, it's size will be adjusted to the buttontext !

Don't use the keyword 'Default' for the height and width of the button !

Just set a blank string to get the result ... :)

#include <GuiConstants.au3>

$gui=GUICreate("Background", 800, 300, -1, -1)
$id1=GUICtrlCreateButton("I am Default",Default,Default,110,110)
$id2=GUICtrlCreateButton('I have the same size',150,50,'','',$bs_defpushbutton)

    $msg = GUIGetMsg()
    IF $msg=$id1 Then MsgBox(0,"","Told ya I'm default")
    IF $msg=$id2 Then MsgBox(0,"","Don't use 'Default', just set a blank string !")
Until $msg = $GUI_EVENT_CLOSE

I hope this is the thing you mean !?


Edited by Greenhorn

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  


Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.