blumi Posted April 14, 2011 Posted April 14, 2011 I have a GUI with a textbox. I want to make a button with "copy to clipboard and Exit" How to realize to mark all text and copy to clipboard? Thanks
UEZ Posted April 14, 2011 Posted April 14, 2011 What is a textbox? Further have a look to Clipboard functions in the help file! Br, UEZ Please don't send me any personal message and ask for support! I will not reply! Selection of finest graphical examples at Codepen.io The own fart smells best! ✌Her 'sikim hıyar' diyene bir avuç tuz alıp koşma!¯\_(ツ)_/¯ ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ
blumi Posted April 14, 2011 Author Posted April 14, 2011 _ClipBoard_SetData sounds good, will read about it. Textbox, I meant GUICtrlCreateEdit ;-)
taietel Posted April 14, 2011 Posted April 14, 2011 (edited) Something like this? #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGui = GUICreate("Form1", 299, 184, 192, 114) $hEdit = GUICtrlCreateEdit("", 8, 8, 281, 137, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_NOHIDESEL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "This is a text. Press the button to put to Clipboard...") $hButton = GUICtrlCreateButton("Put to Clipboard", 184, 152, 107, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $hButton ClipPut(GUICtrlRead($hEdit)) MsgBox(0,"Done!","Your data is in the Clipboard.") Exit EndSwitch WEnd Edited April 14, 2011 by taietel Things you should know first...In the beginning there was only ONE! And zero... Progs: Reveal hidden contents Create PDF(TXT2PDF,IMG2PDF) 3D Bar Graph DeskGadget Menu INI Photo Mosaic 3D Text
blumi Posted April 14, 2011 Author Posted April 14, 2011 On 4/14/2011 at 9:43 AM, 'taietel said: Something like this? #include <EditConstants.au3> #include <GUIConstantsEx.au3> #include <WindowsConstants.au3> $hGui = GUICreate("Form1", 299, 184, 192, 114) $hEdit = GUICtrlCreateEdit("", 8, 8, 281, 137, BitOR($ES_AUTOVSCROLL,$ES_AUTOHSCROLL,$ES_NOHIDESEL,$ES_WANTRETURN,$WS_VSCROLL)) GUICtrlSetData(-1, "This is a text. Press the button to put to Clipboard...") $hButton = GUICtrlCreateButton("Put to Clipboard", 184, 152, 107, 25, $WS_GROUP) GUISetState(@SW_SHOW) While 1 $nMsg = GUIGetMsg() Switch $nMsg Case $GUI_EVENT_CLOSE Exit Case $hButton ClipPut(GUICtrlRead($hEdit)) MsgBox(0,"Done!","Your data is in the Clipboard.") Exit EndSwitch WEnd Yes, that is perfect. Thanks
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