Jump to content

Recommended Posts

Posted (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 by vollyman
Posted

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
Posted

#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

Posted (edited)

Strange, they are both centred on my computer.

Running latest release on win xp pro sp2

Edit - typo

Edited 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

Posted

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

I have Windows 2003 Server SP1, same as yours.

Posted

I'm running the the latest release (which isn't beta in case you didn't know :P) and I get the

same as you volleyman. I'm also running WinXP SP2.

Posted

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

Posted (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 by BPBNA
Posted

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

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
×
×
  • Create New...