Jump to content

GUI Delete and Create


Recommended Posts

Hey All,

 

I am trying to create a GUI from within a GUI that when I click the button on the first GUI it will create the secondary GUI but once its done I want to remove the secondary GUI (all functions from it removed unless I click the same button again). I have been trying different ways to achieve this and feel its likely due to menot understanding to a T or mis placing something in the script.

Throughout my entire program it has 4 GUIs but I never call them back so I typically just use SW_HIDE but if I delete something from using a Button and if I click a parent button shouldnt it bring it back if the parent button lists it that way or is it because im calling a separate function it doesnt work? Anywho here is the chunk that isnt working for me.

;Portion that calls the new GUI (taskbar icon)
Case $emailMenu
    Call(EmailSupportR)
    
Func EmailSupportR()
    ;UI
    $EmailSupport = GUICreate("Email Support", 578, 494, 220, 158)
    GUISetBkColor(0xFFFFE1)
    ;Check Boxes
    $Team1 = GUICtrlCreateCheckbox("Team1", 8, 8, 145, 17)
    $Team2 = GUICtrlCreateCheckbox("Team2", 8, 24, 105, 17)
    $Team3 = GUICtrlCreateCheckbox("Team3", 160, 8, 105, 17)
    $Team4 = GUICtrlCreateCheckbox("Team4", 8, 40, 97, 17)
    $Team5 = GUICtrlCreateCheckbox("Team5", 8, 56, 97, 17)
    $Team6 = GUICtrlCreateCheckbox("Team6", 160, 24, 97, 17)
    $Team7 = GUICtrlCreateCheckbox("Team7", 160, 40, 97, 17)
    $Team8 = GUICtrlCreateCheckbox("Team8", 160, 56, 129, 17)
    ;Input fields in UI
    $TitleofEmail = GUICtrlCreateInput("", 8, 80, 553, 21)
    $BodyofEmail = GUICtrlCreateEdit("", 8, 112, 561, 329, BitOR($ES_WANTRETURN, $WS_VSCROLL))
    GUICtrlSetData(-1, "")
    ;Buttons in UI
    $EmailSubmit = GUICtrlCreateButton("Submit", 152, 448, 75, 25)
    $emailexit = GUICtrlCreateButton("Exit", 248, 448, 75, 25)
    GuiSetState(@SW_Show)
    While 1
        Sleep(10)
    Switch GuiGetMsg()

        Case $GUI_EVENT_CLOSE
            GuiDelete($EmailSupport)
        Case $emailexit
            GuiDelete($EmailSupport)
        Case $EmailSubmit
            Msgbox(0,"","working on this")


    EndSwitch
WEnd

EndFunc

The Effect I have is once I click my $emailMenu(taskbar button) the GUI loads but the Taskbar program stops working. :( 

I also just tried putting Call the original program back in which I think is the right way but it replicates my data(I guess I need to focus on ensuring I dont duplicate the data from the Call).

AlsoI tried hide and then re showing as well which it shows the first GUIs I hid. 

 

If I am missing it in the helpful please feel free to point me to the right portion, i literally was scrolling 1 piece at a time trying to find what I was looking for and possibly am just misunderstanding myself. >.>

Link to comment
Share on other sites

Just needed a fresh day looking at the helpfiles and fixed it.

 

Case $GUI_EVENT_CLOSE
            GuiDelete($EmailSupport)
            Return
        Case $emailexit
            GuiDelete($EmailSupport)
            Return
        Case $EmailSubmit
            Msgbox(0,"","working on this")
            GuiDelete($EmailSupport)
            Return

 

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...