Jump to content

Resizable labels?


JRowe
 Share

Recommended Posts

I want to resize a label while the script is running. In fact, I want to have multiple resizeable labels on a form.

Does anyone know if theres a simple property for this?

Link to comment
Share on other sites

Is there any way to use the WS_Sizebox property, or do I have to code it myself? :D Thanks for the quick response, btw :D

For example,

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 441, 193, 133)
$Label1 = GUICtrlCreateLabel("", 132, 104, 76, 84)
GUICtrlSetBkColor(-1, 0x0054E3)
GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit

    EndSwitch
WEnd

And I just want to resize $Label1

Edited by Jrowe
Link to comment
Share on other sites

Hi,

#include <GUIConstants.au3>

$Form1 = GUICreate("Form1", 633, 441, 193, 133)
$Label1 = GUICtrlCreateLabel("", 132, 104, 76, 84)
GUICtrlSetBkColor(-1, 0x0054E3)
$Button = GUICtrlCreateButton("Resize Label", 5, 5, 100, 20)

GUISetState(@SW_SHOW)

While 1
    $nMsg = GUIGetMsg()
    Switch $nMsg
        Case $GUI_EVENT_CLOSE
            Exit
        Case $Button
            Local $CGP = ControlGetPos($Form1, "", $Label1)
            GUICtrlSetPos($Label1, $CGP[0], $CGP[1], Random(10, 200, 1), Random(10, 200, 1))
    EndSwitch
WEnd

Cheers

Link to comment
Share on other sites

I didn't make myself clear, and I apologize. What I'm after is clicking on the border (rebar?) and dragging the corners or sides of the label to manually resize it.

Thank you very much for the help so far, though!

Link to comment
Share on other sites

You can let it resize with the GUI :

#include <GUIConstants.au3>

#region - GUI Create
GUICreate('fg',-1,-1,-1,-1,$WS_SIZEBOX)
$x = GUICtrlCreateLabel("jkjk",10,10,100,100)
GUICtrlSetResizing(-1,$GUI_DOCKBORDERS)
GUICtrlSetBkColor(-1,0xFF0000)
GUISetState()
#endregion

#region - GUI SelectLoop
While 1
    $msg = GUIGetMsg()
    Select
        Case $msg = $GUI_EVENT_CLOSE
            Exit
    EndSelect
WEnd
#endregion

*GERMAN* [note: you are not allowed to remove author / modified info from my UDFs]My UDFs:[_SetImageBinaryToCtrl] [_TaskDialog] [AutoItObject] [Animated GIF (GDI+)] [ClipPut for Image] [FreeImage] [GDI32 UDFs] [GDIPlus Progressbar] [Hotkey-Selector] [Multiline Inputbox] [MySQL without ODBC] [RichEdit UDFs] [SpeechAPI Example] [WinHTTP]UDFs included in AutoIt: FTP_Ex (as FTPEx), _WinAPI_SetLayeredWindowAttributes

Link to comment
Share on other sites

Aye, yeah. However, I want to have 16-20 draggable, resizable boxes on the form, something like the GUI designers. I basically want it as a layout tool, and I was thinking it wouldn't be too complex if I could find some control that already did what I wanted it to :)

Thanks for the help, so far, but it's still not quite what I'm looking for.

Link to comment
Share on other sites

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