faustf Posted November 12, 2011 Share Posted November 12, 2011 hi guy i have i little questions. example: i have one form1 whit input box and button (name is address ). when i click over button appear in pupup style a new form2 . in form 2 have listview i want select one of item and clik over button (ok ), and insert a item in input box in form1. how is possible do this ?? ? i dont have idea thanks Link to comment Share on other sites More sharing options...
water Posted November 12, 2011 Share Posted November 12, 2011 In the Wiki you can find a tutorial that describes how to handle multiple GUIs. My UDFs and Tutorials: Spoiler UDFs:Active Directory (NEW 2022-02-19 - Version 1.6.1.0) - Download - General Help & Support - Example Scripts - WikiExcelChart (2017-07-21 - Version 0.4.0.1) - Download - General Help & Support - Example ScriptsOutlookEX (2021-11-16 - Version 1.7.0.0) - Download - General Help & Support - Example Scripts - WikiOutlookEX_GUI (2021-04-13 - Version 1.4.0.0) - DownloadOutlook Tools (2019-07-22 - Version 0.6.0.0) - Download - General Help & Support - WikiPowerPoint (2021-08-31 - Version 1.5.0.0) - Download - General Help & Support - Example Scripts - WikiTask Scheduler (NEW 2022-07-28 - Version 1.6.0.1) - Download - General Help & Support - Wiki Standard UDFs:Excel - Example Scripts - WikiWord - Wiki Tutorials:ADO - WikiWebDriver - Wiki Link to comment Share on other sites More sharing options...
faustf Posted November 12, 2011 Author Share Posted November 12, 2011 but in wiki dont explain how to send information cross gui only for push button Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 12, 2011 Moderators Share Posted November 12, 2011 faustf, You do it like this: expandcollapse popup#include <GUIConstantsEx.au3> Global $hGUI2 = 9999, $hButton2 = 9999, $hListView = 9999 Global $aListViewItem[10] gui1() Func gui1() $hGUI1 = GUICreate("Gui 1", 200, 200, 100, 100) $hInput = GUICtrlCreateInput("", 10, 10, 180, 20) $hButton1 = GUICtrlCreateButton("Show Gui 2", 10, 60, 80, 30) GUISetState() While 1 $aMsg = GUIGetMsg(1) Switch $aMsg[1] Case $hGUI1 Switch $aMsg[0] Case $GUI_EVENT_CLOSE ExitLoop Case $hButton1 GUICtrlSetState($hButton1, $GUI_DISABLE) gui2() EndSwitch Case $hGUI2 Switch $aMsg[0] Case $hButton2 $sSelected_Data = StringTrimRight(GUICtrlRead(GUICtrlRead($hListView)), 1) If $sSelected_Data <> "" Then GUICtrlSetData($hInput, $sSelected_Data) EndIf ContinueCase Case $GUI_EVENT_CLOSE GUIDelete($hGUI2) GUICtrlSetState($hButton1, $GUI_ENABLE) EndSwitch EndSwitch WEnd EndFunc ;==>gui1 Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) $hListView = GUICtrlCreateListView("Data ", 10, 10, 180, 100) For $i = 0 To 9 $aListViewItem[$i] = GUICtrlCreateListViewItem("Item " & $i, $hListView) Next $hButton2 = GUICtrlCreateButton("Send Data", 10, 130, 80, 30) GUISetState() EndFunc ;==>gui2 All clear? Now you have used up your free code allowance for a while. In future please post a working script so that we can work on it - we do not really like having to script something from scratch. OK? M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
faustf Posted November 12, 2011 Author Share Posted November 12, 2011 ok thanks you have understund what i want do Link to comment Share on other sites More sharing options...
faustf Posted November 12, 2011 Author Share Posted November 12, 2011 but i have a questions suppose i create a form whit out sitax of case but in this mode _form1() func _form1() . . .input box GUICtrlSetOnEvent($Button3, "_form2") endfunc func _form2() list view ? ? ? endfunc ;=============================================================== ;Keep the GUI alive ;=============================================================== While 1 Sleep(1000) WEnd Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2011 Moderators Share Posted November 13, 2011 faustf,I take it that you want to know how to code that script in OnEvent mode. If so, then this is one way how it might be done: expandcollapse popup#include <GUIConstantsEx.au3> Opt("GUIOnEventMode", 1) Global $hGUI2 = 9999, $hButton1 = 9999, $hInput = 9999, $hButton2 = 9999, $hListView = 9999 Global $aListViewItem[10] gui1() Func gui1() $hGUI1 = GUICreate("Gui 1", 200, 200, 100, 100) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI1_Exit") $hInput = GUICtrlCreateInput("", 10, 10, 180, 20) $hButton1 = GUICtrlCreateButton("Show Gui 2", 10, 60, 80, 30) GUICtrlSetOnEvent(-1, "On_Button1") GUISetState() While 1 Sleep(10) WEnd EndFunc ;==>gui1 Func On_Button1() GUICtrlSetState($hButton1, $GUI_DISABLE) gui2() EndFunc Func On_Button2() $sSelected_Data = StringTrimRight(GUICtrlRead(GUICtrlRead($hListView)), 1) If $sSelected_Data <> "" Then GUICtrlSetData($hInput, $sSelected_Data) EndIf GUI2_Exit() EndFunc Func gui2() $hGUI2 = GUICreate("Gui 2", 200, 200, 350, 350) GUISetOnEvent($GUI_EVENT_CLOSE, "GUI2_Exit") $hListView = GUICtrlCreateListView("Data ", 10, 10, 180, 100) For $i = 0 To 9 $aListViewItem[$i] = GUICtrlCreateListViewItem("Item " & $i, $hListView) Next $hButton2 = GUICtrlCreateButton("Send Data", 10, 130, 80, 30) GUICtrlSetOnEvent(-1, "On_Button2") GUISetState() EndFunc ;==>gui2 Func GUI1_Exit() Exit EndFunc Func GUI2_Exit() GUIDelete($hGUI2) GUICtrlSetState($hButton1, $GUI_ENABLE) EndFuncPlease ask if there is anything you do not understand. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area Link to comment Share on other sites More sharing options...
faustf Posted November 13, 2011 Author Share Posted November 13, 2011 why you set this? ? Global $hGUI2 = 9999, Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted November 13, 2011 Moderators Share Posted November 13, 2011 faustf,Certain variables have to be declared at the top of the script or you get errors when you run Au3Check warning you of "undeclared variables". The variables you need to declare are all created within functions and so are automatically Local in scope - declaring them as Global allows them to be used within all functions. The inability to pass parameters in OnEvent mode (unless you use martin's UDF) is one reason I tend not to use it much. And why 9999? Well, why not? The Variables - using Global, Local and ByRef tutorial in the Wiki will explain aboit variable scope in more detail. M23 Any of my own code posted anywhere on the forum is available for use by others without any restriction of any kind Open spoiler to see my UDFs: Spoiler ArrayMultiColSort ---- Sort arrays on multiple columnsChooseFileFolder ---- Single and multiple selections from specified path treeview listingDate_Time_Convert -- Easily convert date/time formats, including the language usedExtMsgBox --------- A highly customisable replacement for MsgBoxGUIExtender -------- Extend and retract multiple sections within a GUIGUIFrame ---------- Subdivide GUIs into many adjustable framesGUIListViewEx ------- Insert, delete, move, drag, sort, edit and colour ListView itemsGUITreeViewEx ------ Check/clear parent and child checkboxes in a TreeViewMarquee ----------- Scrolling tickertape GUIsNoFocusLines ------- Remove the dotted focus lines from buttons, sliders, radios and checkboxesNotify ------------- Small notifications on the edge of the displayScrollbars ----------Automatically sized scrollbars with a single commandStringSize ---------- Automatically size controls to fit textToast -------------- Small GUIs which pop out of the notification area 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