Spikemg1 Posted January 9, 2019 Share Posted January 9, 2019 (edited) This post has 2 issues. (Yes I know this is a very basic looking GUI setup.) 1: When I close the child GUI, the parent GUI breaks. ( I dont want the parent GUI to close. This is supposed to be an end user kiosk terminal.) 2: The Conference Phone checkbox isn't working like the others, even though they are set up the exact same way. expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### Form= Global $Form1 = GUICreate("Form1", 1921, 1080) GUICtrlSetResizing(-1, 1) GUICtrlSetBkColor(-1, 0xFFFFFF) Global $Button1 = GUICtrlCreateButton("SIGN OUT", 203, 364, 731, 289) GUICtrlSetFont(-1, 100, 800, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0x00FF00) Global $Button2 = GUICtrlCreateButton("SIGN IN", 987, 364, 731, 289) GUICtrlSetFont(-1, 100, 800, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0xFF0000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Button1 #Region ### START Koda GUI section ### Form= Global $Form2 = GUICreate("Form2", 1920, 1080) GUICtrlSetResizing(-1, 1) GUICtrlSetBkColor(-1, 0xFFFFFF) Global $Name = GUICtrlCreateLabel("Name", 150, 100, 196, 92) GUICtrlSetFont(-1, 30, 400, 0, "@Microsoft YaHei") Global $Dept = GUICtrlCreateLabel("Department", 150, 200, 230, 92) GUICtrlSetFont(-1, 30, 400, 0, "@Microsoft YaHei") Global $AVLaptop1 = GUICtrlCreateLabel("AV Laptop 1", 1000, 100, 400, 92) GUICtrlSetFont(-1, 30, 400, 0, "@Microsoft YaHei") Global $AVLaptop2 = GUICtrlCreateLabel("AV Laptop 2", 1000, 200, 400, 92) GUICtrlSetFont(-1, 30, 400, 0, "@Microsoft YaHei") Global $cPhone = GUICtrlCreateLabel("Confrence Phone", 1000, 300, 557, 92) GUICtrlSetFont(-1, 30, 400, 0, "@Microsoft YaHei") Global $Projector = GUICtrlCreateLabel("Projector", 1000, 400, 298, 92) GUICtrlSetFont(-1, 30, 400, 0, "@Microsoft YaHei") Global $Input1 = GUICtrlCreateInput("", 300, 100, 500, 60) GUICtrlSetFont(-1, 30, 900, 0, "@Microsoft YaHei") Global $Checkbox1 = GUICtrlCreateLabel("", 1400, 100, 80, 90, 0x1201) GUICtrlSetFont(-1, 75, 900, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $Checkbox2 = GUICtrlCreateLabel("", 1400, 200, 80, 90, 0x1201) GUICtrlSetFont(-1, 75, 900, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $Checkbox3 = GUICtrlCreateLabel("", 1400, 300, 80, 90, 0x1201) GUICtrlSetFont(-1, 75, 900, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $Checkbox4 = GUICtrlCreateLabel("", 1400, 400, 80, 90, 0x1201) GUICtrlSetFont(-1, 75, 900, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0xFFFFFF) Global $Confirm = GUICtrlCreateButton("Confirm", 1256, 816, 291, 137) GUICtrlSetFont(-1, 48, 800, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0x00FF00) Global $OutHome = GUICtrlCreateButton("Home", 1552, 816, 291, 137) GUICtrlSetFont(-1, 48, 800, 0, "@Microsoft YaHei") GUICtrlSetBkColor(-1, 0xFF0000) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $Checkbox1 Switch GUICtrlRead($Checkbox1) Case "" GUICtrlSetData($Checkbox1, "X") Case Else GUICtrlSetData($Checkbox1, "") EndSwitch Case $Checkbox2 Switch GUICtrlRead($Checkbox2) Case "" GUICtrlSetData($Checkbox2, "X") Case Else GUICtrlSetData($Checkbox2, "") EndSwitch Case $Checkbox3 Switch GUICtrlRead($Checkbox3) Case "" GUICtrlSetData($Checkbox3, "X") Case Else GUICtrlSetData($Checkbox3, "") EndSwitch Case $Checkbox4 Switch GUICtrlRead($Checkbox4) Case "" GUICtrlSetData($Checkbox4, "X") Case Else GUICtrlSetData($Checkbox4, "") EndSwitch Case $Confirm Global $File = FileOpen(@DesktopDir & "\Test Input File.txt", 1) FileWrite($File, GUICtrlRead($Input1) & ", " & GUICtrlRead($Checkbox1) & ", " & GUICtrlRead($Checkbox2) & ", " & GUICtrlRead($Checkbox3) & ", " & GUICtrlRead($Checkbox4) & ", " & @CRLF) FileClose($File) GUIDelete($Form2) ExitLoop Case $OutHome GUIDelete($Form2) ExitLoop EndSwitch WEnd Case $Button2 Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited January 9, 2019 by Spikemg1 Link to comment Share on other sites More sharing options...
Nine Posted January 9, 2019 Share Posted January 9, 2019 you need to exitloop after guidelete “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Spikemg1 Posted January 9, 2019 Author Share Posted January 9, 2019 5 minutes ago, Nine said: you need to exitloop after guidelete I dont want the parent gui to close. Link to comment Share on other sites More sharing options...
Nine Posted January 9, 2019 Share Posted January 9, 2019 Just now, Spikemg1 said: I dont want the parent gui to close. no I mean exitloop of the child. if you dont it will continue forever... “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Spikemg1 Posted January 9, 2019 Author Share Posted January 9, 2019 (edited) 9 minutes ago, Nine said: no I mean exitloop of the child. if you dont it will continue forever... ok fixed thanks forgot to put ($Form1) after GUIDelete Case $Confirm Global $File = FileOpen(@DesktopDir & "\Test Input File.txt", 1) FileWrite($File, GUICtrlRead($Input1) & ", " & GUICtrlRead($Checkbox1) & ", " & GUICtrlRead($Checkbox2) & ", " & GUICtrlRead($Checkbox3) & ", " & GUICtrlRead($Checkbox4) & ", " & @CRLF) FileClose($File) GUIDelete($Form1) ExitLoop Case $OutHome GUIDelete($Form1) ExitLoop Edited January 9, 2019 by Spikemg1 Link to comment Share on other sites More sharing options...
Spikemg1 Posted January 9, 2019 Author Share Posted January 9, 2019 @Nine Any ideas on the checkbox? Link to comment Share on other sites More sharing options...
Nine Posted January 9, 2019 Share Posted January 9, 2019 2 minutes ago, Spikemg1 said: Any ideas on the checkbox? If I like checkbox ? Yes thank you for asking ! JK, maybe it could be a little more explanatory “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Subz Posted January 9, 2019 Share Posted January 9, 2019 GuiCtrlRead($id...", 1) to obtain the checkbox text. Link to comment Share on other sites More sharing options...
Nine Posted January 9, 2019 Share Posted January 9, 2019 btw your 2 forms are called $Form1, not a good idea ! “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Spikemg1 Posted January 9, 2019 Author Share Posted January 9, 2019 6 minutes ago, Nine said: If I like checkbox ? Yes thank you for asking ! JK, maybe it could be a little more explanatory lol sorry I ment any idea as toi why the "X" isn't showing up when selected? Link to comment Share on other sites More sharing options...
Spikemg1 Posted January 9, 2019 Author Share Posted January 9, 2019 Just now, Nine said: btw your 2 forms are called $Form1, not a good idea ! Good Point lol thanks Link to comment Share on other sites More sharing options...
Nine Posted January 9, 2019 Share Posted January 9, 2019 ok, you need to use constants. like $GUI_CHECKED “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Spikemg1 Posted January 9, 2019 Author Share Posted January 9, 2019 Changes have been updated. Link to comment Share on other sites More sharing options...
Nine Posted January 9, 2019 Share Posted January 9, 2019 But you dont need to check the box yourself, gui will do that for you, all you need to do is to $ischeck 1 = (GUICtrlRead ($checkbox1) = $GUI_CHECKED) $ischeck1 will true if checked and false otherwise “They did not know it was impossible, so they did it” ― Mark Twain Spoiler Block all input without UAC Save/Retrieve Images to/from Text Monitor Management (VCP commands) Tool to search in text (au3) files Date Range Picker Virtual Desktop Manager Sudoku Game 2020 Overlapped Named Pipe IPC HotString 2.0 - Hot keys with string x64 Bitwise Operations Multi-keyboards HotKeySet Recursive Array Display Fast and simple WCD IPC Multiple Folders Selector Printer Manager GIF Animation (cached) Screen Scraping Multi-Threading Made Easy Link to comment Share on other sites More sharing options...
Spikemg1 Posted January 9, 2019 Author Share Posted January 9, 2019 29 minutes ago, Nine said: ok, you need to use constants. like $GUI_CHECKED Found the issue... the confrence phone label was so long that it covered the checkbox which prevented it from being clickable. 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