michaelslamet Posted December 30, 2012 Posted December 30, 2012 (edited) Hi, I have a very strange behaviour of GUICtrlCreateLabel: it sometime show label, sometime it doesn't. I try to trap it using msgbox and everytime the msgbox is get executed so there is no reason the GUICtrlCreataLabel doesn't. If $price_found = True then $display_price = GuiCtrlCreateLabel("Price is : " & NumberCommas($price), 250, 60, $SS_NOTIFY) ;msgbox (0,0,"this message box is executed everytime") endif Tested with $SS_NOTIFY and without. What is the logic explanation for this and how to solve this? Thanks! :-) Edited December 30, 2012 by michaelslamet
michaelslamet Posted December 30, 2012 Author Posted December 30, 2012 (edited) Seems like this only happen if I run it from editor. This is working fine if I run from the exe file (after compiling it) EDIT: NOT REALLY, running from exe file or from editor bring the same result! Edited December 30, 2012 by michaelslamet
Developers Jos Posted December 30, 2012 Developers Posted December 30, 2012 show us a replicator script which we can run and see your issue. SciTE4AutoIt3 Full installer Download page - Beta files Read before posting How to post scriptsource Forum etiquette Forum Rules Live for the present, Dream of the future, Learn from the past.
michaelslamet Posted December 30, 2012 Author Posted December 30, 2012 Thanks Jos I try to create a replicator script, but I cant produce the error, so I do try and error on the original script. Seems like I found the solution. I have two GUI: Global $hGUI = GuiCreate("title", 540, 560) Global $hGui_Preview = GUICreate("", $hGui_PreviewSize, $hGui_PreviewSize + 58, -1, -1, $WS_POPUP + $WS_BORDER, $WS_EX_TOPMOST, $hGUI) Initial status is: GUISetState(@SW_HIDE, $hGui_Preview) GUISetState(@SW_SHOW, $hGUI) Seems like sometime the GUICtrlCreataLabel write to the a wrong GUI ($hGui_Preview instead of $hGUI) hence the text doesn't display. Add GUISetState(@SW_SHOW, $hGUI) to this seems solve the problem: Do GUISetState(@SW_SHOW, $hGUI) $msg = GUIGetMsg() blbalbla Until False Thanks for reading this and trying to help
Moderators Melba23 Posted December 30, 2012 Moderators Posted December 30, 2012 michaelslamet,Seems like sometime the GUICtrlCreataLabel write to the a wrong GUI ($hGui_Preview instead of $hGUI)If you have multiple GUIs, use GUISwitch to define the one in which you want the controls to appear just before starting their creation. 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
michaelslamet Posted December 30, 2012 Author Posted December 30, 2012 michaelslamet,If you have multiple GUIs, use GUISwitch to define the one in which you want the controls to appear just before starting their creation. M23Ok, noted with thanks, M23 :-)
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