Find Code:
All Words
Any of the Words
Exact Phrase
Home
:
Code
:
Forums
:
Submit
:
Mailing List
:
About
:
Contact
Code
All
VB.NET
ASP.NET
C#
VB Classic
ASP Classic
Snippets
Popular
Resources
Submit Code
Forums
Articles
Tips
Links
Books
Contest
Link to us
Play with Clipboard without WinAPI. ...
Author:
Alok Rai
E-mail:
Click to e-mail author
Submitted:
5/28/2001
Version:
VB5
Compatibility:
VB5
Category:
Controls
Views:
8807
Play with Clipboard without WinAPI.
Declarations:
Nothing First of all put one image control and one rich text control and three push button labelled "Display Clipboard data","Clear Clipboard data",Save Data to Clipboar" and run the form .
Code:
Private Sub Command1_Click() RichTextBox1.Text = "" RichTextBox1.TextRTF = "" If Clipboard.GetFormat(vbCFText) Then MsgBox "The Clipboard contains only text.", vbSystemModal, "Clipboard" RichTextBox1.Visible = True Image1.Visible = False RichTextBox1.Text = Clipboard.GetText() ElseIf Clipboard.GetFormat(vbCFBitmap) Then RichTextBox1.Visible = False Image1.Visible = True MsgBox "The Clipboard contains the Bitmap.", vbSystemModal, "Clipboard" Picture = Clipboard.GetData() Image1.Picture = Picture ElseIf Clipboard.GetFormat(vbCFDIB) Then Image1.Visible = False RichTextBox1.Visible = True MsgBox "The Clipboard contains only rich text.", vbSystemModal, "Clipboard" RichTextBox1.TextRTF = Clipboard.GetText() ElseIf Clipboard.GetFormat(vbCFRTF) Then Image1.Visible = False RichTextBox1.Visible = False MsgBox "There is nothing on the Clipboard.", vbSystemModal, "Clipboard" End If End Sub Private Sub Command2_Click() Clipboard.Clear End Sub Private Sub Command3_Click() If RichTextBox1.Visible = True Then Clipboard.SetText RichTextBox1.Text Else Clipboard.SetData Image1.Picture End If End Sub Private Sub Form_Load() Image1.Visible = False RichTextBox1.Visible = False End Sub
Home
|
Forums
|
Submit
|
Books
|
Mailing List
|
Advertising
|
About
|
Contact
© 2024 A1VBCode. All rights reserved.
Legal disclaimer & terms of use
Privacy statement