Click here to Skip to main content
15,867,871 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
Hello, how can i use the clipboard in vb.net?
Posted

1 solution

If it is really the clipboard, and really VB.NET it is not a good idea at all. Web based apps do not have any access to the Client clipboard - and there is only the one server clipboard so using that will produce unpredictable results depending on what else is going on.

If this is a Windows app of some form, then just use the Clipboard class[^]
 
Share this answer
 
Comments
easy 11 18-Oct-12 11:02am    
it is not working but i had an error : Comma, ')', or a valid expression continuation expected. wthen i use System.Windows.Forms.Clipboard.GetData()
so what is the Problem?
OriginalGriff 18-Oct-12 11:59am    
Assuming there is data on the clipboard you need to supply the format to use GetData:
http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard.getdata.aspx
And see
http://msdn.microsoft.com/en-us/library/system.windows.forms.dataformats.aspx

Alternatively, you could use one of the more specific methods: GetText for example
http://msdn.microsoft.com/en-us/library/system.windows.forms.clipboard.gettext.aspx

You should check first to see what kind of data is on the clipboard via one of the ContainsXXX methods (see MSDN, it lists them)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900