perccapt Posted July 14, 2010 Share Posted July 14, 2010 Here is some code that I am writing. My basic functionality is to have multiple memberIDs run multiple queries. I would like to save the queries by title and when you click on the Query name it would display in the box below a list of titles. I have no idea on how to store and retrieve both these elements together. Any thoughts would be much appreciated! expandcollapse popup#include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <ListViewConstants.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #include <GUIListBox.au3> Local $Query,$QueryTitle,$Q_Name,$Q_Query Dim $AddQueryButton = 1 Dim $Query_Number = 0 #Region ### START Koda GUI section ### Form= $Form1_1 = GUICreate("Form1", 779, 353, 351, 123) $Edit1 = GUICtrlCreateList("", 56, 72, 185, 266) GUICtrlSetData(-1, "") $Button1 = GUICtrlCreateButton("+", 8, 40, 35, 25, $WS_GROUP) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Button2 = GUICtrlCreateButton("-", 8, 64, 35, 25, $WS_GROUP) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Button7 = GUICtrlCreateButton("c", 8, 88, 35, 25, $WS_GROUP) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Label1 = GUICtrlCreateLabel("Member IDs", 56, 8, 106, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $memberadd = GUICtrlCreateInput("", 56, 40, 185, 21) GUICtrlSetLimit (-1,11,11) $Button3 = GUICtrlCreateButton("+", 256, 40, 35, 25, $WS_GROUP) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Button4 = GUICtrlCreateButton("-", 256, 64, 35, 25, $WS_GROUP) GUICtrlSetFont(-1, 14, 800, 0, "MS Sans Serif") $Label2 = GUICtrlCreateLabel("Queries", 304, 8, 71, 28) GUICtrlSetFont(-1, 14, 400, 0, "MS Sans Serif") $Run = GUICtrlCreateButton("Run", 680, 41, 89, 31, $WS_GROUP) $Exit = GUICtrlCreateButton("Exit", 680, 81, 89, 31, $WS_GROUP) $Edit2 = GUICtrlCreateEdit("", 304, 152, 361, 185) $List1 = GUICtrlCreateList("", 304, 40, 361, 97) GUICtrlSetData(-1, "") GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $Exit Exit Case $Button1 Call("Add") Case $Button2 Call("Delete") Case $Button3 Call("AddQ") Case $AddQueryButton Call("Add_Query") EndSwitch WEnd Func Add() $Member =GUICtrlRead($memberadd) $HowBig = StringLen($Member) $IssaNumber = StringIsInt($Member) If $HowBig = 11 And $IssaNumber = 1 Then GUICtrlSetData($memberadd,"") GUICtrlSetData($Edit1,$Member&"|") _GUICtrlListBox_Sort($Edit1) Else GUICtrlSetData($memberadd,"") msgbox(-1,"Not a valid Member","Not a valid Member ID") EndIf EndFunc Func Delete() $Chosen = _GUICtrlListBox_GetCurSel($Edit1) _GUICtrlListBox_DeleteString($Edit1,$Chosen) EndFunc Func Clear () EndFunc Func AddQ() #Region ### START Koda GUI section ### Form=\\sltcp-dfs\home\tpedrick\scripts\queryadd.kxf $Form2 = GUICreate("Query Add", 377, 283, 797, 429) $QueryTitle = GUICtrlCreateInput("", 8, 8, 361, 21) $Query = GUICtrlCreateEdit("", 8, 40, 361, 193) $AddQueryButton = GUICtrlCreateButton("Add", 151, 248, 75, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### EndFunc Func Add_Query() $Query_Number = $Query_Number +1 $Q_Name =GUICtrlRead($QueryTitle) $Q_Query = GUICtrlRead($Query) msgbox(-1,"$Q_Name",$Q_Name) msgbox(-1,"$Q_Query",$Q_Query) EndFunc 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