supadodger Posted November 28, 2010 Share Posted November 28, 2010 i am trying to create a statusbar for my gui but reading the help file im not getting anywhere... $Label1 = GUICtrlCreateLabel("11203 of 50000 results", 0, 152, 132, 17) ;GUICtrlSetBkColor(-1, 0xF0F0F0) $Label2 = GUICtrlCreateLabel("abcdefghijk", 136, 152, 604, 25) ;GUICtrlSetBkColor(-1, 0xF0F0F0) $Progress1 = GUICtrlCreateProgress(744, 152, 150, 25) ;$Progress1 = GUICtrlCreateProgress(16, 152, 750, 33) local $Aparts[3] = [126,127,128] $hstatus = _GUICtrlStatusBar_Create($Form1,$aparts) ;_GuiCtrlStatusbar_SetParts ($hstatus,1,132) _GUICtrlStatusBar_EmbedControl ($hStatus, 1, $Progress1) _GUICtrlStatusBar_EmbedControl ($hStatus, 2, $Label1) _GUICtrlStatusBar_EmbedControl ($hStatus, 3, $Label2) im trying to have 1 progress bar and 2 text labels inside of my statusbar! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 28, 2010 Moderators Share Posted November 28, 2010 supadodger,The forum "Search" facility is at top right - might be a good idea to use it now and again. Then you could easily find out how to do what you want: expandcollapse popup#include <GuiConstantsEx.au3> #include <GuiStatusBar.au3> #include <ProgressConstants.au3> ; Set right edges of status parts Local $aParts[3] = [150, 300, -1] ; Create GUI $hGUI = GUICreate("StatusBar Embed Control", 500, 300) ; Create statusbar $hStatus = _GUICtrlStatusBar_Create($hGUI) _GUICtrlStatusBar_SetMinHeight($hStatus, 20) _GUICtrlStatusBar_SetParts($hStatus, $aParts) GUISetState() ; Set text in first 2 parts _GUICtrlStatusBar_SetText($hStatus, "11203 of 50000 results") _GUICtrlStatusBar_SetText($hStatus, "abcdefghijk", 1) ; Embed a progress bar in third part $hProgress = GUICtrlCreateProgress(0, 0, -1, -1, $PBS_SMOOTH) $hProgress_Handle = GUICtrlGetHandle($hProgress) _GUICtrlStatusBar_EmbedControl($hStatus, 2, $hProgress_Handle) ; For progress advance $iProg_Set = 0 $iBegin = TimerInit() ; Loop until user exits While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE Exit EndSwitch ; Make progress advance If TimerDiff($iBegin) > 50 Then $iProg_Set = Mod($iProg_Set + 1, 100) GUICtrlSetData($hProgress, $iProg_Set + 1) GUICtrlSetData($hProgress, $iProg_Set) $iBegin = TimerInit() EndIf WEndYou will find that the progress does not reappear if you minimize and restore the GUI - but I will let you find out how to solve that (hint: searching for "+embedded +statusbar" will give you the answer fairly quickly)! 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...
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