Sign in to follow this  
Followers 0
michaelslamet

[SOLVED] Very Strange: GUICtrlCreateLabel sometime show text, sometime not

6 posts in this topic

#1 ·  Posted (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 by michaelslamet

Share this post


Link to post
Share on other sites



#2 ·  Posted (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 by michaelslamet

Share this post


Link to post
Share on other sites

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 :)

Share this post


Link to post
Share on other sites

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

 

Share this post


Link to post
Share on other sites

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

M23

Ok, noted with thanks, M23 :-)

Share this post


Link to post
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
Sign in to follow this  
Followers 0