Sign in to follow this  
Followers 0
Thornhunt

ok my last question..

4 posts in this topic

ok i know this is easy to do but i cant do it.

ok can some one please do this for me. iv tried my best and givven up.

heres the code

#include <GUIConstants.au3>

GUICreate("Spybot Compiled", 500, 500)                                          ; will create a dialog box that when displayed is centered
$background = GUICtrlCreatePic ("Untitled-1.jpg", 0, 0, 500, 500)               ; background
GuiCtrlSetState(-1,$GUI_DISABLE)
GUISetState (@SW_SHOW)                                                        ; will display an empty dialog box

$clicktostart = GUICtrlCreateLabel ("Click to start SpyBot Compiled ", 55, 41, 175)
GUICtrlSetFont($clicktostart, 9, 700)
GUICtrlSetBkColor($clicktostart, $GUI_BKCOLOR_TRANSPARENT)

$Button1 = GUICtrlCreateButton ( "  start  ", 10, 40 )                      ; verification button

$Button2 = GUICtrlCreateButton ( "  exit  ", 10, 80 )                       ; verification button

while 1
GUICtrlSetOnEvent ( $Button1, "ok" )

GUICtrlSetOnEvent ( $Button2, "close" )

WEnd

what i need is for $button1 to close the current open gui and open up another that is the same size and has the same bg(size and bg i can do its jus making the button work)

and for the second button to open up a message that asks if you want to exit . with a yes and no option .. so that choosing yes would close down the script and that no would return the user to the start gui

can some one help please.

i dont seem to be lerning anything from the help file..

thank u

-paul-


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

Share this post


Link to post
Share on other sites



cant understand what you want the 1st button to do exacly, but ive done the rest:

#include <GUIConstants.au3>
$Gui = GUICreate("Spybot Compiled", 500, 500)   ; will create a dialog box that when displayed is centered
$background = GUICtrlCreatePic("Untitled-1.jpg", 0, 0, 500, 500)    ; background
GUICtrlSetState(-1, $GUI_DISABLE)
$clicktostart = GUICtrlCreateLabel("Click to start SpyBot Compiled ", 55, 41, 175)
GUICtrlSetFont($clicktostart, 9, 700)
GUICtrlSetBkColor($clicktostart, $GUI_BKCOLOR_TRANSPARENT)
$Button1 = GUICtrlCreateButton("  start  ", 10, 40)     ; verification button
$Button2 = GUICtrlCreateButton("  exit  ", 10, 80)  ; verification button
GUISetState()     ; will display an empty dialog box
While 1
    $msg = GUIGetMsg()
    If $msg = $Button1 Then
        GUISetState(@SW_HIDE,$Gui)
        ;do what you want
    EndIf
    If $msg = $Button2 Or $msg = $GUI_EVENT_CLOSE Then ;GUI_EVENT_CLOSE is for the exit button
        $msgbx = MsgBox(4, '', 'Do you want to exit?')
        If $msgbx = 6 Then
            Exit
        EndIf
    EndIf
WEnd

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Normally I don't use the GUI-On-Event-Mode. But you could try this, if you want to solve the problem with GUI-On-Event-Mode:

....

GUICtrlSetOnEvent ( $Button1, "ok" )

GUICtrlSetOnEvent ( $Button2, "close" )

while 1
  Sleep(1000)
WEnd

Func ok()
  Do what you want
EndFunc

Func close()
  Do what you want 2
EndFunc
Edited by Lynix

Share this post


Link to post
Share on other sites

thank you :).. this is perfect :P

ill be sure to post my script when its fini .. thanks

uv help loads


Budweiser + room = warm beerwarm beer + fridge = too long!warm beer + CO2 fire extinguisher = Perfect![quote]Protect the easly offended ... BAN EVERYTHING[/quote]^^ hmm works for me :D

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