Jump to content

GUICtrlCreateLabel


anixon
 Share

Recommended Posts

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.. ;)

Link to comment
Share on other sites

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.. ;)

Link to comment
Share on other sites

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
Link to comment
Share on other sites

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
Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...