notsure Posted September 21, 2009 Share Posted September 21, 2009 Hello. I'm trying to build a multiple form GUI. This is the code; While 1 $nMsg = GUIGetMsg(1) If @sec <> $sec then GUICtrlSetData($lbltime, @hour & ":" & @min & ":" & @SEC) $sec = @sec endif Select Case $nMsg[0] = $cmdAdd And $nMsg[1] = $main AddFunc() ;$item1 = GUICtrlCreateListViewItem($time & "|" & $note & "|" & $prio, $listview1) Case $nMsg[0] = $GUI_EVENT_CLOSE And $nMsg[1] = $frmAdd guidelete($frmadd) Case $nMsg[0] = $GUI_EVENT_CLOSE And $nMsg[1] = $main Exit Case $nMsg[0] = $cmdCancel And $nMsg[1] = $frmAdd guidelete($frmadd) EndSelect WEnd If i start the code, the form dissapears without any error to the tray and is "pauzed". If I delete the 2 lines below: Case $nMsg[0] = $cmdCancel And $nMsg[1] = $frmAdd guidelete($frmadd) it actually works. Why does the GUI disappear when i insert those 2 lines? I cant find any logical explanation for this... Link to comment Share on other sites More sharing options...
Manjish Posted September 21, 2009 Share Posted September 21, 2009 Hello. I'm trying to build a multiple form GUI. This is the code; While 1 $nMsg = GUIGetMsg(1) If @sec <> $sec then GUICtrlSetData($lbltime, @hour & ":" & @min & ":" & @SEC) $sec = @sec endif Select Case $nMsg[0] = $cmdAdd And $nMsg[1] = $main AddFunc() ;$item1 = GUICtrlCreateListViewItem($time & "|" & $note & "|" & $prio, $listview1) Case $nMsg[0] = $GUI_EVENT_CLOSE And $nMsg[1] = $frmAdd guidelete($frmadd) Case $nMsg[0] = $GUI_EVENT_CLOSE And $nMsg[1] = $main Exit Case $nMsg[0] = $cmdCancel And $nMsg[1] = $frmAdd guidelete($frmadd) EndSelect WEnd If i start the code, the form dissapears without any error to the tray and is "pauzed". If I delete the 2 lines below: Case $nMsg[0] = $cmdCancel And $nMsg[1] = $frmAdd guidelete($frmadd) it actually works. Why does the GUI disappear when i insert those 2 lines? I cant find any logical explanation for this... Can you pls post the full code. [font="Garamond"]Manjish Naik[/font]Engineer, Global Services - QPSHoneywell Automation India LimitedE-mail - Manjish.Naik@honeywell.com Link to comment Share on other sites More sharing options...
mistersquirrle Posted October 4, 2009 Share Posted October 4, 2009 If i start the code, the form dissapears without any error to the tray and is "pauzed". If I delete the 2 lines below: Case $nMsg[0] = $cmdCancel And $nMsg[1] = $frmAdd guidelete($frmadd) it actually works. Why does the GUI disappear when i insert those 2 lines? I cant find any logical explanation for this... Since you don't have the full code posted, so we can't test it I can only guess... but I'm thinking that it has something to do with you trying to control two GUIs at once. I don't know if that's really possible... I tried replicating your code (to an minimal) and I got a bad loop error for some reason, where it just kept creating a second GUI. Lucky it didn't crash my computer. I know you can control one, create another, and take control of that one, then switch back if you delete that one... but I'm not quite sure how to control two. If you can live with not controling two GUIs at once, have the other GUI be a function in its self, and have this: Case $GUI_EVENT_CLOSE GUIDelete() ExitLoop that will delete the second GUI (most recently created) and exit the loop getting the $nMsg for it, and go back to your main GUI window. We ought not to misbehave, but we should look as though we could. Link to comment Share on other sites More sharing options...
CodyBarrett Posted October 4, 2009 Share Posted October 4, 2009 using multiple GUIs i find it easier to use Onevent and @GUI_CTRLID and @GUI_WINHANDLE to get which window and control is being used easier for me... but To eaches Own right? [size="1"][font="Tahoma"][COMPLETED]-----[FAILED]-----[ONGOING]VolumeControl|Binary Converter|CPU Usage| Mouse Wrap |WinHide|Word Scrammbler|LOCKER|SCREEN FREEZE|Decisions Decisions|Version UDF|Recast Desktop Mask|TCP Multiclient EXAMPLE|BTCP|LANCR|UDP serverless|AIOCR|OECR|Recast Messenger|AU3C|Tik-Tak-Toe|Snakes & Ladders|BattleShips|TRON|SNAKE_____________________[u]I love the Helpfile it is my best friend.[/u][/font][/size] 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