Jump to content

(solved) Multiline Label control possible?


Recommended Posts

Is there a control style to make labels span multiple lines, because I am not seeing one..  And I would think that, since the control itself is just displayed text, it would have something like that....

Edited by MattHiggs
Link to comment
Share on other sites

You can use CR/LF/CRLF in a label to make it move to the next line. There is no default way to make a long string for a label break up into multiple lines, like an edit.

The easiest way to do it would be to use an edit control with the $ES_READONLY.

The next best thing would be to check out this thread I posted in a while back

 

Which will measure the string against the control and break it up into an array, each row representing a line.

Link to comment
Share on other sites

  • Moderators

MattHiggs,

Take a look at my StringSize UDF (the link is in my sig) - it allows you to wrap a long string into a given width or determine what size label you need to fit the string.

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

$idMainlabel = GUICtrlCreateLabel($sMainstatus, 4, 112, 616, 350, $SS_LEFT + $SS_NOPREFIX)

and then

;reset main status
    $sMainstatus = $sMainstatus & StringLeft($textlabel, 25) & StringRight($textrpt, 15) & @CRLF
    GUICtrlSetData($idMainlabel, $sMainstatus)

the StringLEFT and StringRIGHT allows you to build two columns in your label.

 

Skysnake

Why is the snake in the sky?

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