Sign in to follow this  
Followers 0
blumi

Copy to clipboard

5 posts in this topic

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

Share this post


Link to post
Share on other sites



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!
¯\_(ツ)_/¯  ٩(●̮̮̃•̃)۶ ٩(-̮̮̃-̃)۶ૐ

Share this post


Link to post
Share on other sites

_ClipBoard_SetData sounds good, will read about it.

Textbox, I meant GUICtrlCreateEdit ;-)

Share this post


Link to post
Share on other sites

#4 ·  Posted (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 by taietel

Share this post


Link to post
Share on other sites

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

Share this post


Link to post
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
Sign in to follow this  
Followers 0