Jump to content

guibutton


Cloudsx
 Share

Recommended Posts

i made a Guicreate

but in the Guicreate i want to place a button that is also work but here is the problem

if i press the button then there must come another Guicreat how can i make something like that

this i my script

Code

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered

GUISetState (@SW_SHOW); will display an empty dialog box

Opt("GUICoordMode",3)

GUICtrlCreateButton("gebouwen",290,100,60)

GUISetState ();this wil create a button

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit

Wend

Edited by Cloudsx
Link to comment
Share on other sites

i made a Guicreate

but in the Guicreate i want to place a button that is also work but here is the problem

if i press the button then there must come another Guicreat how can i make something like that

this i my script

Code

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered

GUISetState (@SW_SHOW); will display an empty dialog box

Opt("GUICoordMode",3)

$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)

GUISetState ();this wil create a button

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit

if $msg = $gebouwen Then GUICreate("gebouwen",200,200)

Wend

moin, moin...:o!

i think you should use a function for the second GUI, look at my suggest.

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW); will display an empty dialog box



Opt("GUICoordMode",3)
$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)

GUISetState ();this wil create a button



While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit
if $msg = $gebouwen Then GUI2Create()

Wend

Func GUI2Create()
GUICreate("gebouwen",200,200)
GUISetState (@SW_SHOW)
While 1
$msg = GUIGetMsg()
If $msg = $GUI_EVENT_CLOSE Then Exit
Wend
EndFunc

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
Share on other sites

i may be wrong here but i never suggest creating a GUI in the function... especially when this script has just started

i always suggest creating the Gui(s) then set the state to "SHOW" when a button is pushed

i have seen too many here creating GUIs in a loop and having many problems

8)

NEWHeader1.png

Link to comment
Share on other sites

and how about this how can i use more Guicreate in this

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered

GUISetState (@SW_SHOW); will display an empty dialog box

Opt("GUICoordMode",4)

$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)

GUICtrlCreateButton("militair",290,125,60)

GUICtrlCreateButton("onderzoek",290,150,60)

GUICtrlCreateButton("verdediging",290,175,61)

GUICtrlCreateButton("overzicht",290,200,60)

GUISetState ();this wil create a button

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit

if $msg = $gebouwen Then GUI2Create()

Wend

Func GUI2Create()

GUICreate("gebouwen",350,350)

GUISetState (@SW_SHOW)

While 1

$smg = GUIGetMsg()

If $smg = $GUI_EVENT_CLOSE then Exit

WEnd

EndFunc

Edited by Cloudsx
Link to comment
Share on other sites

and how about this how can i use more Guicreate in this

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered

GUISetState (@SW_SHOW); will display an empty dialog box

Opt("GUICoordMode",4)

$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)

GUICtrlCreateButton("militair",290,125,60)

GUICtrlCreateButton("onderzoek",290,150,60)

GUICtrlCreateButton("verdediging",290,175,61)

GUICtrlCreateButton("overzicht",290,200,60)

GUISetState ();this wil create a button

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit

if $msg = $gebouwen Then GUI2Create()

Wend

Func GUI2Create()

GUICreate("gebouwen",350,350)

GUISetState (@SW_SHOW)

While 1

$smg = GUIGetMsg()

If $smg = $GUI_EVENT_CLOSE then Exit

WEnd

EndFunc

by every action you could create one more GUI, but if you want to make more button it is better to use Select Case EndSelect

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
Share on other sites

#include <GUIConstants.au3>

GUICreate("game",350,400, 200, 100); will create a dialog box that when displayed is centered
GUISetState (@SW_SHOW); will display an empty dialog box


Opt("GUICoordMode",4)

GUICreate("game2",350,400); will create a dialog box that when displayed is centered
$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)
GUICtrlCreateButton("militair",290,125,60)
GUICtrlCreateButton("onderzoek",290,150,60)
GUICtrlCreateButton("verdediging",290,175,61)
GUICtrlCreateButton("overzicht",290,200,60)

GUISetState ();this wil create a button



While 1
$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit
if $msg = $gebouwen Then GUI2Create()

Wend

Func GUI2Create()
GUICreate("gebouwen",350,350, 400, 200)
GUISetState (@SW_SHOW)

While 1
$smg = GUIGetMsg()
If $smg = $GUI_EVENT_CLOSE then Exit
WEnd
EndFunc

8)

NEWHeader1.png

Link to comment
Share on other sites

how does it work with Select Case EndSelect

could you show me please

While 1
$msg = GUIGetMsg()
    Case $msg = $gebouwen1
        statement1
    Case $msg = $gebouwen2
        statement2
    Case $msg = $gebouwen3
        statement3
        .
        .
        .
    Case $msg = $GUI_EVENT_CLOSE 
        Exit
Wend
please use the help file :o

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
Share on other sites

While 1
$msg = GUIGetMsg()
Select 
    Case $msg = $gebouwen1
        statement1
    Case $msg = $gebouwen2
        statement2
    Case $msg = $gebouwen3
        statement3
        .
        .
        .
    Case $msg = $GUI_EVENT_CLOSE 
        Exit
EndSelect
Wend
please use the help file :o
sorry, I forgott it with select

[font="Comic Sans Ms"][center]Powered by AutoIt3http://www.wik-eric.de/zips/Synchro2.2.2-4free.zip[/center][/font]

Link to comment
Share on other sites

i want to have more Guicreate in this for the buttons

CODE

#include <GUIConstants.au3>

GUICreate("game",350,400); will create a dialog box that when displayed is centered

GUISetState (@SW_SHOW); will display an empty dialog box

Opt("GUICoordMode",4)

$gebouwen = GUICtrlCreateButton("gebouwen",290,100,60)

GUICtrlCreateButton("militair",290,125,60)

GUICtrlCreateButton("onderzoek",290,150,60)

GUICtrlCreateButton("verdediging",290,175,61)

GUICtrlCreateButton("overzicht",290,200,60)

GUISetState ();this wil create a button

While 1

$msg = GUIGetMsg()

If $msg = $GUI_EVENT_CLOSE Then Exit

if $msg = $gebouwen Then GUI2Create()

Wend

Func GUI2Create()

GUICreate("gebouwen",350,350)

GUISetState (@SW_SHOW)

While 1

$smg = GUIGetMsg()

If $smg = $GUI_EVENT_CLOSE then Exit

WEnd

EndFunc

Edited by Cloudsx
Link to comment
Share on other sites

but now i have some problem with the exit

here is the example

i have 2 dialogs

child 1 and child 2

if i press on the button in child 1 then child 2 opens

but if i want to close the child 2 on the big red X in the upper right corner then it will close both of the

childs

how can i turn that of

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...