Bert Posted August 24, 2006 Share Posted August 24, 2006 (edited) I made a example script to show what I'm attempting: #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Button1" & @CRLF & "test", 30, 30, 160, 70) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit I want the button to be displayed so it says "button 1" above the word "test", instead of in one line, which it does now. Any ideas? I could do a pic, but I like to stay away from that, for I want to be able to change the text of the button depending on how a ini setting is configured. Edit:I also know I can use $BS_MULTILINE, but that won't do what I want. I need to set what text is on each line, not just have it wrap Edited August 24, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Bert Posted August 24, 2006 Author Share Posted August 24, 2006 I came up with this, but the second line is to the left. I need that line to be centered also. The second line will have the variable text, so using spaces won't do it. #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Button1" & @CRLF & "test", 30, 30, 150, 70, $BS_CENTER + $BS_MULTILINE) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
BigDod Posted August 24, 2006 Share Posted August 24, 2006 #include <GuiConstants.au3> GuiCreate("MyGUI", 392, 323,-1, -1 , BitOR($WS_OVERLAPPEDWINDOW, $WS_CLIPSIBLINGS)) $Button_1 = GuiCtrlCreateButton("Button1" & @CRLF & "test", 30, 30, 160, 70, $BS_MULTILINE) GuiSetState() While 1 $msg = GuiGetMsg() Select Case $msg = $GUI_EVENT_CLOSE ExitLoop Case Else ;;; EndSelect WEnd Exit Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Bert Posted August 24, 2006 Author Share Posted August 24, 2006 (edited) does the same thing. It will put the word "test" to the left, at the same indent as the word "button". How do I make the word "test" be centered on the button? example of what it is doing now: Example of what I want it to do: Edited August 24, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
BigDod Posted August 24, 2006 Share Posted August 24, 2006 (edited) Strange, they are both centred on my computer. Running latest release on win xp pro sp2 Edit - typo Edited August 24, 2006 by BigDod Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
Bert Posted August 24, 2006 Author Share Posted August 24, 2006 (edited) odd. I have SP2, and ...wait...let me update with the latest beta. edit...nope...still happening.. anyone else tried the example to see if it works? It may just be my PC Edited August 24, 2006 by vollyman The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
Joon Posted August 24, 2006 Share Posted August 24, 2006 odd. I have SP2, and ...wait...let me update with the latest beta.edit...nope...still happening..anyone else tried the example to see if it works? It may just be my PCI have Windows 2003 Server SP1, same as yours. Link to comment Share on other sites More sharing options...
Helge Posted August 24, 2006 Share Posted August 24, 2006 I'm running the the latest release (which isn't beta in case you didn't know ) and I get the same as you volleyman. I'm also running WinXP SP2. Link to comment Share on other sites More sharing options...
joshiieeii Posted August 24, 2006 Share Posted August 24, 2006 (edited) I tried both sets of code on my PC, they were both centered... *EDIT: What about Scite? Updated as well? Edited August 24, 2006 by joshiieeii Projects:Vista Gui ImageX Deployment Tool - CompletedActive Directory Helper - CompletedGlobalized Outlook and OWA Signature Project - Completed Link to comment Share on other sites More sharing options...
Bert Posted August 24, 2006 Author Share Posted August 24, 2006 yep, latest SciTe also. This is odd. Would this be a bug? The Vollatran project My blog: http://www.vollysinterestingshit.com/ Link to comment Share on other sites More sharing options...
BigDod Posted August 24, 2006 Share Posted August 24, 2006 I have figured out what the problem is. If I change to Windows classic theme I get the same as you but using the Windows XP theme I get it centred. I do not know how to fix it so that it is the same for both. Time you enjoyed wasting is not wasted time ......T.S. Elliot Suspense is worse than disappointment................Robert Burns God help the man who won't help himself, because no-one else will...........My Grandmother Link to comment Share on other sites More sharing options...
BPBNA Posted August 24, 2006 Share Posted August 24, 2006 (edited) Looks like that is the problem... weird. I'm running WinXP SP2 with XP theme and its centered. Edit: what about $BS_CENTER? From the help file - "Centers the text horizontally in the button rectangle." I tried switching to classic to test it, but it stayed the same even without the $BS_CENTER... I didn't restart though. Edited August 24, 2006 by BPBNA Link to comment Share on other sites More sharing options...
Xenobiologist Posted August 24, 2006 Share Posted August 24, 2006 Hi, XP SP1 Theme XP centered! So long, Mega Scripts & functions Organize Includes Let Scite organize the include files Yahtzee The game "Yahtzee" (Kniffel, DiceLion) LoginWrapper Secure scripts by adding a query (authentication) _RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...) Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc. MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times Link to comment Share on other sites More sharing options...
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