manelesux Posted December 5, 2007 Posted December 5, 2007 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 below2.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) GUISetState(@SW_SHOW) do $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
Zedna Posted December 5, 2007 Posted December 5, 2007 (edited) Try to play with Opt('GUICoordMode',2) Maybe it helps but maybe it's only for positions and not dimensions. Edited December 5, 2007 by Zedna Resources UDF ResourcesEx UDF AutoIt Forum Search
Greenhorn Posted December 6, 2007 Posted December 6, 2007 (edited) 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) GUISetState(@SW_SHOW) Do $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 !? Greetz Edited December 6, 2007 by Greenhorn
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