Results 1 to 9 of 9

Thread: [RESOLVED] Copy to clipboard

  1. #1

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Resolved [RESOLVED] Copy to clipboard

    Anyone know how you copy something from a label to a clipboard. (The Ctrl + C) ? I think its called clipboard... =)

    //Thanks in advance
    //Thomas
    My hobbies:
    Vb 6.0, Studio 2010, Webbdesign (PHP, Mysql, CSS, Javascript, HTML)

    Programming hobbies:
    Vb 6.0: Work, Vb 2010: Login system to acces internet game, Webbdesign: Creating an advanced Text-based browser-game Called Banner

    Other word:
    Programming a game and an API to the game, while working and learning and
    P.S. I am still a basic programmer so i listend to every advice i get

  2. #2
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Copy to clipboard

    Code:
    Private Sub Command1_Click()
        Clipboard.SetText Label1.Caption
    End Sub
    ...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  3. #3

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: Copy to clipboard

    Thank you akhil =) Youre allways here =)
    My hobbies:
    Vb 6.0, Studio 2010, Webbdesign (PHP, Mysql, CSS, Javascript, HTML)

    Programming hobbies:
    Vb 6.0: Work, Vb 2010: Login system to acces internet game, Webbdesign: Creating an advanced Text-based browser-game Called Banner

    Other word:
    Programming a game and an API to the game, while working and learning and
    P.S. I am still a basic programmer so i listend to every advice i get

  4. #4
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Copy to clipboard

    You're welcome...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  5. #5

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: Copy to clipboard

    for some reason it only worked first time. after that it doesnt change as i press the button...

    i got the code in label1.click if that makes any diffrent.
    My hobbies:
    Vb 6.0, Studio 2010, Webbdesign (PHP, Mysql, CSS, Javascript, HTML)

    Programming hobbies:
    Vb 6.0: Work, Vb 2010: Login system to acces internet game, Webbdesign: Creating an advanced Text-based browser-game Called Banner

    Other word:
    Programming a game and an API to the game, while working and learning and
    P.S. I am still a basic programmer so i listend to every advice i get

  6. #6
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: Copy to clipboard

    Try this:
    Code:
    Private Sub Label1_Click()
        Clipboard.Clear '~~~ This will clear the clipboard contents
        Clipboard.SetText Label1.Caption    '~~~ Copies the caption to the Clipboard
    End Sub
    ...

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

  7. #7

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: Copy to clipboard

    thank you that works perfect =)
    My hobbies:
    Vb 6.0, Studio 2010, Webbdesign (PHP, Mysql, CSS, Javascript, HTML)

    Programming hobbies:
    Vb 6.0: Work, Vb 2010: Login system to acces internet game, Webbdesign: Creating an advanced Text-based browser-game Called Banner

    Other word:
    Programming a game and an API to the game, while working and learning and
    P.S. I am still a basic programmer so i listend to every advice i get

  8. #8

    Thread Starter
    Hyperactive Member goofan's Avatar
    Join Date
    Nov 2009
    Location
    Sweden
    Posts
    296

    Re: [RESOLVED] Copy to clipboard

    Thanks for marking this resolved =)
    My hobbies:
    Vb 6.0, Studio 2010, Webbdesign (PHP, Mysql, CSS, Javascript, HTML)

    Programming hobbies:
    Vb 6.0: Work, Vb 2010: Login system to acces internet game, Webbdesign: Creating an advanced Text-based browser-game Called Banner

    Other word:
    Programming a game and an API to the game, while working and learning and
    P.S. I am still a basic programmer so i listend to every advice i get

  9. #9
    Freelancer akhileshbc's Avatar
    Join Date
    Jun 2008
    Location
    Trivandrum, Kerala, India
    Posts
    7,652

    Re: [RESOLVED] Copy to clipboard

    You're welcome....

    If my post was helpful to you, then express your gratitude using Rate this Post.
    And if your problem is SOLVED, then please Mark the Thread as RESOLVED (see it in action - video)
    My system: AMD FX 6100, Gigabyte Motherboard, 8 GB Crossair Vengance, Cooler Master 450W Thunder PSU, 1.4 TB HDD, 18.5" TFT(Wide), Antec V1 Cabinet

    Social Group: VBForums - Developers from India


    Skills: PHP, MySQL, jQuery, VB.Net, Photoshop, CodeIgniter, Bootstrap,...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width