malble12i Posted April 7, 2018 Share Posted April 7, 2018 (edited) Hi every one, can you help me set an click to the input named "$iid", thank all! P/s: Here is my code (below) #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1 = GUICreate("Form1", 391, 518, 192, 124) $iid = GUICtrlCreateInput("", 0, 392, 385, 21) GUICtrlSetLimit ($iid , 63) $c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21) $copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25, $WS_GROUP) $cid = GUICtrlCreateInput("", 0, 456, 353, 21) $copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25, $WS_GROUP) $atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25, $WS_GROUP) $ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25, $WS_GROUP) $slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25, $WS_GROUP) $re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25, $WS_GROUP) $out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd Edited April 7, 2018 by Melba23 Added code tags Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2018 Moderators Share Posted April 7, 2018 malble12i, Welcome to the AutoIt forums. I presume you want the cursor to be placed in that input - if so then just give it focus: $iid = GUICtrlCreateInput("", 0, 392, 385, 21) GUICtrlSetState($iid, $GUI_FOCUS) M23 P.S. When you post code please use Code tags - see here how to do it. Then you get a scrolling box and syntax colouring as you can see above now I have added the tags. 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...
malble12i Posted April 7, 2018 Author Share Posted April 7, 2018 Okay, thank you! Can you set click to the input and send the code for me? Thank you! Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2018 Moderators Share Posted April 7, 2018 malble12i, Quote send the code What do you think that code in my previous post does? 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...
malble12i Posted April 7, 2018 Author Share Posted April 7, 2018 1 minute ago, Melba23 said: malble12i, What do you think that code in my previous post does? M23 No, I want to setup a click to the input, can you set it? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2018 Moderators Share Posted April 7, 2018 malble12i, You need to add that additional GUICtrlSetState line immediately after the control creation line - just as I posted it above. Then you will have the cursor in the input when the GUI opens. M23 Earthshine 1 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...
malble12i Posted April 7, 2018 Author Share Posted April 7, 2018 2 minutes ago, Melba23 said: malble12i, You need to add that additional GUICtrlSetState line immediately after the control creation line - just as I posted it above. Then you will have the cursor in the input when the GUI opens. M23 Thank you, but I'm a noob, can you give me the example? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2018 Moderators Share Posted April 7, 2018 malble21i, Sigh...... #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1 = GUICreate("Form1", 391, 518, 192, 124) $iid = GUICtrlCreateInput("", 0, 392, 385, 21) GUICtrlSetState($iid, $GUI_FOCUS) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetLimit ($iid , 63) $c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21) $copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25, $WS_GROUP) $cid = GUICtrlCreateInput("", 0, 456, 353, 21) $copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25, $WS_GROUP) $atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25, $WS_GROUP) $ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25, $WS_GROUP) $slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25, $WS_GROUP) $re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25, $WS_GROUP) $out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd 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...
malble12i Posted April 7, 2018 Author Share Posted April 7, 2018 2 minutes ago, Melba23 said: malble21i, Sigh...... #include <ButtonConstants.au3> #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <StaticConstants.au3> #include <WindowsConstants.au3> #Region ### START Koda GUI section ### $Form1 = GUICreate("Form1", 391, 518, 192, 124) $iid = GUICtrlCreateInput("", 0, 392, 385, 21) GUICtrlSetState($iid, $GUI_FOCUS) ; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< GUICtrlSetLimit ($iid , 63) $c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21) $copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25, $WS_GROUP) $cid = GUICtrlCreateInput("", 0, 456, 353, 21) $copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25, $WS_GROUP) $atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25, $WS_GROUP) $ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25, $WS_GROUP) $slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25, $WS_GROUP) $re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25, $WS_GROUP) $out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25, $WS_GROUP) GUISetState(@SW_SHOW) #EndRegion ### END Koda GUI section ### While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit EndSwitch WEnd M23 Sorry, but can you set "If I click to the Input, it will Exit"? Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2018 Moderators Share Posted April 7, 2018 malble12i, Please explain what you actually want to do because that makes no sense to me whatsoever. You click in an input so that you can enter data, not to exit a script. 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...
malble12i Posted April 7, 2018 Author Share Posted April 7, 2018 I want to click to the input, and it will set a data from clipboard Link to comment Share on other sites More sharing options...
Moderators Melba23 Posted April 7, 2018 Moderators Share Posted April 7, 2018 (edited) malble21i, Then you should have said so at the beginning: expandcollapse popup#include <GUIConstantsEx.au3> $Form1 = GUICreate("Form1", 391, 518, 192, 124) $iid = GUICtrlCreateInput("", 0, 392, 385, 21) GUICtrlSetLimit ($iid , 63) $c_i_d = GUICtrlCreateInput("", 0, 424, 353, 21) $copy_ = GUICtrlCreateButton("Copy", 352, 424, 35, 25) $cid = GUICtrlCreateInput("", 0, 456, 353, 21) $copy = GUICtrlCreateButton("Copy", 352, 456, 35, 25) $atp = GUICtrlCreateButton("ATP COPY", 0, 488, 75, 25) $ospp = GUICtrlCreateButton("OSPP COPY", 80, 488, 75, 25) $slipt = GUICtrlCreateButton("SLIPT", 160, 488, 75, 25) $re = GUICtrlCreateButton("REFRESH", 240, 488, 75, 25) $out = GUICtrlCreateButton("EXIT", 320, 488, 67, 25) GUISetState(@SW_SHOW) ; Just for an example - load the clipboard ClipPut("Just for an example") While 1 Switch GUIGetMsg() Case $GUI_EVENT_CLOSE, $out Exit Case $GUI_EVENT_PRIMARYUP ; The mouse button has been released ; Is the cursor over an input? $aInfo = GUIGetCursorInfo() If IsArray($aInfo) Then Switch $aInfo[4] Case $iid ; Do what you want to do here, for example If Not GUICtrlRead($iid) Then GUICtrlSetData($iid, ClipGet()) EndIf ; will put the clipboard content into the input Case $c_i_d If Not GUICtrlRead($c_i_d) Then GUICtrlSetData($c_i_d, ClipGet()) EndIf Case $cid If Not GUICtrlRead($cid) Then GUICtrlSetData($cid, ClipGet()) EndIf EndSwitch EndIf EndSwitch WEnd M23 P.S. When you reply, please use the "Reply to this topic" button at the top of the thread or the "Reply to this topic" editor at the bottom rather than the "Quote" button - I know what I wrote and it just pads the thread unnecessarily. Edited April 7, 2018 by Melba23 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...
malble12i Posted April 7, 2018 Author Share Posted April 7, 2018 Thank you! 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