FinalVersion Posted April 6, 2010 Share Posted April 6, 2010 How can I set the $lblStablePath and $lblBetaPath to auto adjust the width, so the captions fits? expandcollapse popup#include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> $frmMain = GUICreate("AutoIt Info", 333, 192, 192, 124) $Group1 = GUICtrlCreateGroup("Current Installation", 5, 5, 320, 180) $Group2 = GUICtrlCreateGroup("Stable", 15, 25, 305, 75) $lbl1 = GUICtrlCreateLabel("Version:", 25, 50, 42, 17) $lblStableVer = GUICtrlCreateLabel("Loading...", 70, 50, 166, 17) $lbl2 = GUICtrlCreateLabel("Path:", 35, 75, 29, 17) $lblStablePath = GUICtrlCreateLabel("Loading...", 70, 75, 51, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) $Group3 = GUICtrlCreateGroup("Beta", 15, 100, 305, 75) $lbl3 = GUICtrlCreateLabel("Version:", 25, 125, 42, 17) $lblBetaVer = GUICtrlCreateLabel("Loading...", 70, 125, 51, 17) $lbl4 = GUICtrlCreateLabel("Path:", 35, 150, 29, 17) $lblBetaPath = GUICtrlCreateLabel("Loading...", 70, 150, 51, 17) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateGroup("", -99, -99, 1, 1) GUISetState(@SW_SHOW) $regPath = "HKLM\Software\AutoIt v3\AutoIt" $stableVersion = RegRead($regPath, "Version") $stablePath = RegRead($regPath, "InstallDir") $betaVersion = RegRead($regPath, "betaVersion") $betaPath = RegRead($regPath, "betaInstallDir") GUICtrlSetData($lblStableVer, $stableVersion) GUICtrlSetData($lblStablePath, $stablePath) GUICtrlSetData($lblBetaVer, $betaVersion) GUICtrlSetData($lblBetaPath, $betaPath) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 6, 2010 Moderators Share Posted April 6, 2010 FinalVersion,I think this will help you: [ #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $spath = "C:\I am a very long path\Which needs to be\Shortened to fit\In the label.txt" $hGUI = GUICreate("Test", 500, 500) GUICtrlCreateLabel($sPath, 10, 10, 300, 30, $DT_PATH_ELLIPSIS) GUICtrlCreateLabel($sPath, 10, 50, 300, 30, $DT_END_ELLIPSIS) GUISetState() While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch WEndJust set your label to the max width possible in your GUI and let Windows sort it out. Using GUICtrlRead on the label will return the full path.M23 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 columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
FinalVersion Posted April 6, 2010 Author Share Posted April 6, 2010 Thanks. [center][+] Steam GUI [+][+] Clipboard Tool [+][+] System :: Uptime [+][+] StarCraft II Mouse Trap [+][/center] Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now