Jump to content
Sign in to follow this  
anixon

GUICtrlCreateLabel

Recommended Posts

anixon

This code creates a sunken box filled with a white rectangle however the text is not displayed [covered by the white rectangle] how do you make the text appear [left justified] within the box so that the label has the same appearance as if it was an input box.

CODE
#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

Example()

Func Example()

Local $msg

GUICreate("My GUI state") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("My Text", 10, 17,100,20, $SS_SUNKEN + $SS_WHITERECT)

GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

GUISetState()

; Run the GUI until the dialog is closed

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop

WEnd

EndFunc ;==>Example

Help is always appreciated Ant.. ;)

Share this post


Link to post
Share on other sites
anixon

I think that I have probably answered my own question with the following code:

CODE
GUICtrlCreateLabel("",8,100,245,20)

GUICtrlSetBkColor(-1,0xFFFFFF) ; White

GUICtrlCreateLabel(" Title " ,8,105,245,20)

GUICtrlSetBkColor(-1,0xFFFFFF) ; White

GUICtrlCreateLabel("",8,100,245,25,$SS_GRAYFRAME)

It seems quite convoluted but appear to work. Ant.. ;)

Share this post


Link to post
Share on other sites
rasim

anixon

Example:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
Local $msg

GUICreate("My GUI state") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("My Text", 10, 17,100,20, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFFFFFF)

GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button

GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example

Share this post


Link to post
Share on other sites
anixon

anixon

Example:

#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>

Example()

Func Example()
Local $msg

GUICreate("My GUI state") ; will create a dialog box that when displayed is centered

GUICtrlCreateLabel("My Text", 10, 17,100,20, BitOR($SS_CENTER, $SS_CENTERIMAGE), $WS_EX_CLIENTEDGE)
GUICtrlSetBkColor(-1, 0xFFFFFF)

GUICtrlSetState(-1, $GUI_FOCUS) ; the focus is on this button



GUISetState()

; Run the GUI until the dialog is closed
While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then ExitLoop
WEnd
EndFunc ;==>Example
Excellent that works an absolute treat and thank you for showing me how BitOR works as I am pretty sure that GUICtrlCreateLabel documentation does have a reference to it but there are no examples as to how it is formated within the statement. Thanks again.. Ant.. ;) Edited by anixon

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.