SaeidN Posted November 13, 2016 Posted November 13, 2016 Hi, I had a label showing a timer, after I cut and paste it in a group, it got defected, and showing like the image below. What's the reason for that?
Moderators JLogan3o13 Posted November 13, 2016 Moderators Posted November 13, 2016 @SaeidN You can't seriously expect people to troubleshoot a control on a GUI without posting the code, can you? Help us help you... "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum!
SaeidN Posted November 14, 2016 Author Posted November 14, 2016 (edited) This is the code, click on start and see what will happen. Actually, it happened when I cut and paste the group into the tab. expandcollapse popup#include <GuiEdit.au3> #include <ButtonConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <TabConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1_1 = GUICreate("Form1", 437, 302, 239, 147) Global $Button1 = GUICtrlCreateButton("Start", 176, 256, 75, 25) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") Global $Tab1 = GUICtrlCreateTab(8, 16, 409, 225) Global $TabSheet1 = GUICtrlCreateTabItem("TabSheet1") Global $Group1 = GUICtrlCreateGroup("Group1", 20, 110, 225, 121, -1, $WS_EX_TRANSPARENT) Global $Label2 = GUICtrlCreateLabel("00:00:00", 70, 137, 74, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") Global $Label1 = GUICtrlCreateLabel("Timer", 22, 137, 48, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") Global $test2 = GUICtrlCreateLabel("Test2", 26, 183, 68, 24) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0080) Global $test3 = GUICtrlCreateLabel("", 82, 183, 156, 28) GUICtrlSetFont(-1, 12, 800, 0, "MS Sans Serif") GUICtrlSetColor(-1, 0xFF0000) GUICtrlCreateGroup("", -99, -99, 1, 1) GUICtrlCreateTabItem("") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Button1 AdlibRegister("TimerAdLib",1000) EndSwitch WEnd Func TimerAdLib() Local Static $iCount = 0 $iCount += 1 $sec2time_hour = Int($iCount / 3600) $sec2time_min = Int(($iCount - $sec2time_hour * 3600) / 60) $sec2time_sec = $iCount - $sec2time_hour * 3600 - $sec2time_min * 60 $mtime = StringFormat('%02d:%02d:%02d', $sec2time_hour, $sec2time_min, $sec2time_sec) _GUICtrlEdit_SetText($Label2, $mtime) EndFunc Edited November 14, 2016 by SaeidN
Gianni Posted November 14, 2016 Posted November 14, 2016 use GUICtrlSetData($Label2, $mtime) instead of _GUICtrlEdit_SetText($Label2, $mtime) SaeidN 1 Chimp small minds discuss people average minds discuss events great minds discuss ideas.... and use AutoIt....
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