?
Solved

hwoto:Windows Clipboard data in vb textbox

Posted on 2004-11-23
9
Medium Priority
?
582 Views
Last Modified: 2006-11-17
hello friends

here i have a problem that i want to get the contents of windows clipboard data into vb textbox.

in msword or some application i will select some text and that data will be taken back in vb textbox or string

is it possible please help

0
Comment
Question by:ydramu
  • 3
  • 3
7 Comments
 
LVL 11

Accepted Solution

by:
pratap_r earned 2000 total points
ID: 12654193
thats quite simple.

the Clipboard object will give you access to the clipboard you may access the text using

Clipboard.GetText()

that returns a string which you can use,

if you want to use RTF or HTML or any other format you can use Clipboard.GetData(<format>)

you can check if a particular format is there in the clipboard by using Clipboard.GetFormat(<format>)

i guess in your case Clipboard.GetText() should do.

Have Fun!
Pratap
0
 
LVL 23

Expert Comment

by:gecko_au2003
ID: 12660135
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbcon98/html/vbconworkingwithgraphicformats.asp

http://www.google.com/search?hl=en&q=clipboard.gettext

here are a few URL's that should show you exactly what you want. How ever it is simmiliar to what the above comment shows, except for it has a few extra things like how to use activecontrol and other things.
0
 
LVL 7

Author Comment

by:ydramu
ID: 12661702
Sorry Pratap

I did the same already but it get the data of vb clipboard not the windows clipboard .

0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 11

Expert Comment

by:pratap_r
ID: 12662681
hmm there is no such thing as a seperate clipboard for vb alone.. the windows clipboard is exposed in vb through the ClipBoard object

Have Fun!
Pratap
0
 
LVL 7

Author Comment

by:ydramu
ID: 12673278
pratap
   in windows xp , in computer management in event manager there is a lot events i want to copy all event discriptions into a file by checking whether the source is of Error or not.

If it is Error then i will copy the description with SendKeys "^c"  by selecting the Event Properties with AppActivate "Event Properties". and then I will write the text to a file

but it is not working properly.
0
 
LVL 11

Expert Comment

by:pratap_r
ID: 12673369
ydramu.. there are better ways to get the event log rather than relying on the clipboard. But the approach followed is quite different, i guess you should open a new question for that and close this one.

Have Fun!
Pratap
0
 
LVL 7

Author Comment

by:ydramu
ID: 12703535
ok pratap
i want to close the question
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this post we will learn how to make Android Gesture Tutorial and give different functionality whenever a user Touch or Scroll android screen.
Computer science students often experience many of the same frustrations when going through their engineering courses. This article presents seven tips I found useful when completing a bachelors and masters degree in computing which I believe may he…
Introduction to Processes
Loops Section Overview

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question