Sign in to follow this  
Followers 0
Luigi

Alternative to set a text in botton position in GUICtrlCrateLabel

7 posts in this topic

Hi forum,

I use a GUICtrlCreateLabel in a litte script, the function's label is show a array's cell, and until now, it's work.
Now I need set text in left, center, right, up and middle... unfortunaly, not bottom.

At this moment, I need some control can be set text with this characteristics: *up, middle, bottom and left, center, right.

But, somenthing does not change your aparence when clicked, like a button.

Yes, the buttom change your aparence when clicked, just a small efect... It is not wanted...

GUICtrlCreateLabel its work fine, until now... In my search Style Or ExStyle to button not possible.

(in time, is not impossible, just not easily)

Or is possible remove all button's effect  through a some Style or ExStyle?

Or have another individual control to do something like this*?

Regards,

Detefon


m(o.O)m

Share this post


Link to post
Share on other sites



I am as confused as J1. How about you actually post your script, rather than asking us to whip out the old crystal ball?


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#4 ·  Posted (edited)

Detefon,

Something like this perhaps? :huh:

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

$hGUI = GUICreate("Test", 500, 500)

$cLabel = GUICtrlCreateLabel("", 200, 10, 100, 100)
GUICtrlSetBkColor($cLabel, 0xCCFFCC)

$cButton_Top = GUICtrlCreateButton("Top", 210, 200, 80, 30)
$cButton_Left = GUICtrlCreateButton("Left", 10, 250, 80, 30)
$cButton_Middle = GUICtrlCreateButton("Middle", 210, 250, 80, 30)
$cButton_Right = GUICtrlCreateButton("Right", 400, 250, 80, 30)
$cButton_Bottom = GUICtrlCreateButton("Bottom", 210, 300, 80, 30)

GUISetState()

$sMiddle = @CRLF & @CRLF & @CRLF
$sBottom = @CRLF & @CRLF & @CRLF & @CRLF & @CRLF & @CRLF

While 1
    Switch GUIGetMsg()
        Case $GUI_EVENT_CLOSE
            Exit
        Case $cButton_Top
            GUICtrlSetData($cLabel, "Top")
            GUICtrlSetStyle($cLabel, BitOR($SS_NOTIFY, $SS_CENTER))
        Case $cButton_Left
            GUICtrlSetData($cLabel, $sMiddle & "Left")
            GUICtrlSetStyle($cLabel, BitOR($SS_NOTIFY, $SS_LEFT))
        Case $cButton_Middle
            GUICtrlSetData($cLabel, $sMiddle & "Middle")
            GUICtrlSetStyle($cLabel, BitOR($SS_NOTIFY, $SS_CENTER))
        Case $cButton_Right
            GUICtrlSetData($cLabel, $sMiddle & "Right")
            GUICtrlSetStyle($cLabel, BitOR($SS_NOTIFY, $SS_RIGHT))
        Case $cButton_Bottom
            GUICtrlSetData($cLabel, $sBottom & "Bottom")
            GUICtrlSetStyle($cLabel, BitOR($SS_NOTIFY, $SS_CENTER))
        Case $cLabel
            MsgBox($MB_SYSTEMMODAL, "Hi", "Pressed")
    EndSwitch
WEnd
M23 Edited by Melba23
Typo
1 person likes this

Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

Share this post


Link to post
Share on other sites

Yes!

That is it!

Thank you again Melba! ^^


m(o.O)m

Share this post


Link to post
Share on other sites

Detefon,

Delighted that the old crystal ball gave the right answer once again - I had given it a good polish first mind! :D

M23


Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind._______My UDFs:

Spoiler

ArrayMultiColSort ---- Sort arrays on multiple columns
ChooseFileFolder ---- Single and multiple selections from specified path treeview listing
Date_Time_Convert -- Easily convert date/time formats, including the language used
ExtMsgBox --------- A highly customisable replacement for MsgBox
GUIExtender -------- Extend and retract multiple sections within a GUI
GUIFrame ---------- Subdivide GUIs into many adjustable frames
GUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView items
GUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeView
Marquee ----------- Scrolling tickertape GUIs
NoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxes
Notify ------------- Small notifications on the edge of the display
Scrollbars ----------Automatically sized scrollbars with a single command
StringSize ---------- Automatically size controls to fit text
Toast -------------- Small GUIs which pop out of the notification area

 

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  
Followers 0