Jump to content

Alternative to set a text in botton position in GUICtrlCrateLabel


Luigi
 Share

Go to solution Solved by Melba23,

Recommended Posts

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

Visit my repository

Link to comment
Share on other sites

  • Moderators

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

"Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball

How to get your question answered on this forum!

Link to comment
Share on other sites

  • Moderators
  • Solution

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

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

Link to comment
Share on other sites

  • Moderators

Detefon,

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

M23

Public_Domain.png.2d871819fcb9957cf44f4514551a2935.png Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind

Open spoiler to see 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

 

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