Jump to content

help - butons


wizard
 Share

Recommended Posts

hi i made this tool using koda. I want my buttons to do certain actions, eg Save, load, and Clear the group buttons, can anyone please help me with the Gui.

#include <ButtonConstants.au3>

#include <EditConstants.au3>

#include <GUIConstantsEx.au3>

#include <StaticConstants.au3>

#include <WindowsConstants.au3>

#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Admin\Local Settings\Temp\Rar$EX00.688\Forms\Form11.kxf

$Form1 = GUICreate("Form1", 154, 426, 192, 124)

$Group1 = GUICtrlCreateGroup("Group1", 8, 8, 137, 409)

$Input1 = GUICtrlCreateInput("id1", 16, 24, 121, 21)

$Input2 = GUICtrlCreateInput("id2", 16, 48, 121, 21)

$Input3 = GUICtrlCreateInput("id3", 16, 72, 121, 21)

$Input4 = GUICtrlCreateInput("id4", 16, 96, 121, 21)

$Input5 = GUICtrlCreateInput("id5", 16, 120, 121, 21)

$Input6 = GUICtrlCreateInput("id6", 16, 144, 121, 21)

$Input7 = GUICtrlCreateInput("id7", 16, 168, 121, 21)

$Input8 = GUICtrlCreateInput("id8", 16, 192, 121, 21)

$Input9 = GUICtrlCreateInput("id9", 16, 216, 121, 21)

$Input10 = GUICtrlCreateInput("id10", 16, 240, 121, 21)

$Input11 = GUICtrlCreateInput("id11", 16, 264, 121, 21)

$Input12 = GUICtrlCreateInput("id12", 16, 288, 121, 21)

$Input13 = GUICtrlCreateInput("pasword", 16, 320, 121, 21)

$save = GUICtrlCreateButton("save", 16, 360, 59, 17)

$load = GUICtrlCreateButton("load", 80, 360, 59, 17)

$clear = GUICtrlCreateButton("clear", 16, 384, 123, 25)

GUICtrlCreateGroup("", -99, -99, 1, 1)

GUISetState(@SW_SHOW)

#EndRegion ### END Koda GUI section ###

While 1

$nMsg = GUIGetMsg()

Switch $nMsg

Case $GUI_EVENT_CLOSE

Exit

EndSwitch

WEnd

Link to comment
Share on other sites

This is the way:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Admin\Local Settings\Temp\Rar$EX00.688\Forms\Form11.kxf
$Form1 = GUICreate("Form1", 154, 426, 192, 124)
$Group1 = GUICtrlCreateGroup("Group1", 8, 8, 137, 409)
$Input1 = GUICtrlCreateInput("id1", 16, 24, 121, 21)
$Input2 = GUICtrlCreateInput("id2", 16, 48, 121, 21)
$Input3 = GUICtrlCreateInput("id3", 16, 72, 121, 21)
$Input4 = GUICtrlCreateInput("id4", 16, 96, 121, 21)
$Input5 = GUICtrlCreateInput("id5", 16, 120, 121, 21)
$Input6 = GUICtrlCreateInput("id6", 16, 144, 121, 21)
$Input7 = GUICtrlCreateInput("id7", 16, 168, 121, 21)
$Input8 = GUICtrlCreateInput("id8", 16, 192, 121, 21)
$Input9 = GUICtrlCreateInput("id9", 16, 216, 121, 21)
$Input10 = GUICtrlCreateInput("id10", 16, 240, 121, 21)
$Input11 = GUICtrlCreateInput("id11", 16, 264, 121, 21)
$Input12 = GUICtrlCreateInput("id12", 16, 288, 121, 21)
$Input13 = GUICtrlCreateInput("pasword", 16, 320, 121, 21)
$save = GUICtrlCreateButton("save", 16, 360, 59, 17)
$load = GUICtrlCreateButton("load", 80, 360, 59, 17)
$clear = GUICtrlCreateButton("clear", 16, 384, 123, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $save     ;the buttons/controls handles goes here, every one with its own "case" statement
        Saving()   ;this function is executed upon event

EndSwitch
WEnd 

Func Saving()
    MsgBox(0, "SAVING", "That's how I'm doing it")
EndFunc

... some more reading won't hurt at all ...

SNMP_UDF ... for SNMPv1 and v2c so far, GetBulk and a new example script

wannabe "Unbeatable" Tic-Tac-Toe

Paper-Scissor-Rock ... try to beat it anyway :)

Link to comment
Share on other sites

This is the way:

#include <ButtonConstants.au3>
#include <EditConstants.au3>
#include <GUIConstantsEx.au3>
#include <StaticConstants.au3>
#include <WindowsConstants.au3>
#Region ### START Koda GUI section ### Form=C:\Documents and Settings\Admin\Local Settings\Temp\Rar$EX00.688\Forms\Form11.kxf
$Form1 = GUICreate("Form1", 154, 426, 192, 124)
$Group1 = GUICtrlCreateGroup("Group1", 8, 8, 137, 409)
$Input1 = GUICtrlCreateInput("id1", 16, 24, 121, 21)
$Input2 = GUICtrlCreateInput("id2", 16, 48, 121, 21)
$Input3 = GUICtrlCreateInput("id3", 16, 72, 121, 21)
$Input4 = GUICtrlCreateInput("id4", 16, 96, 121, 21)
$Input5 = GUICtrlCreateInput("id5", 16, 120, 121, 21)
$Input6 = GUICtrlCreateInput("id6", 16, 144, 121, 21)
$Input7 = GUICtrlCreateInput("id7", 16, 168, 121, 21)
$Input8 = GUICtrlCreateInput("id8", 16, 192, 121, 21)
$Input9 = GUICtrlCreateInput("id9", 16, 216, 121, 21)
$Input10 = GUICtrlCreateInput("id10", 16, 240, 121, 21)
$Input11 = GUICtrlCreateInput("id11", 16, 264, 121, 21)
$Input12 = GUICtrlCreateInput("id12", 16, 288, 121, 21)
$Input13 = GUICtrlCreateInput("pasword", 16, 320, 121, 21)
$save = GUICtrlCreateButton("save", 16, 360, 59, 17)
$load = GUICtrlCreateButton("load", 80, 360, 59, 17)
$clear = GUICtrlCreateButton("clear", 16, 384, 123, 25)
GUICtrlCreateGroup("", -99, -99, 1, 1)
GUISetState(@SW_SHOW)
#EndRegion ### END Koda GUI section ###

While 1
$nMsg = GUIGetMsg()
Switch $nMsg
    Case $GUI_EVENT_CLOSE
        Exit
    Case $save     ;the buttons/controls handles goes here, every one with its own "case" statement
        Saving()   ;this function is executed upon event

EndSwitch
WEnd 

Func Saving()
    MsgBox(0, "SAVING", "That's how I'm doing it")
EndFunc

... some more reading won't hurt at all ...

Thanks for the help, but I want my button SAVE to save eg, one,two,three..., button CLEAR, must clear eg, one,two,three.., button LOAD must load the saved info eg,one,two,three... can you also maybe tell me where to read more..
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...