Choose a job you love, and you will never have to work a day in your life.
- Confucius
News
Site News
Latest Comments
Affiliates
Proxies
Contribute!
Chat
Tutorials
Newest Articles
Most Popular
Highest Rated
Latest Comments
Code Samples
Newest Code
Most Popular
Highest Rated
Latest Comments
Blogs
Admins Blog
Newest Blogs
Most Popular
Highest Rated
Latest Comments
Forums
Latest Posts
Latest Topics
Memberlist
[login]
|
[Register]
Cut and Paste
by: bs0d
Description:
VB program allows you to cut, copy and paste information from the clipboard. Check out this code if you're interested in how to copy information with Visual Basic. - (2 txt boxes, 2 labels, edit menu).
See Full Size
Code:
Private Sub Form_Load() 'Will center the form on the screen frmClippboard.Top = (Screen.Height - frmClippboard.Height) / 2 frmClippboard.Left = (Screen.Width - frmClippboard.Width) / 2 End Sub Private Sub mnuCopy_Click() 'Will copy text. Clipboard.Clear Clipboard.SetText txtName1.SelText End Sub Private Sub mnuCut_Click() 'Cuts selected text. Clipboard.Clear 'clears the clipboard Clipboard.SetText txtName1.SelText 'copys selected (hilighted) text to clipboard. txtName1.SelText = "" 'removes text after being cut. End Sub Private Sub mnuPaste_Click() 'Takes info from clipboard, and paste in text2 txtName2.SelText = Clipboard.GetText() Clipboard.Clear End Sub Private Sub mnuEdit_Click() 'Will fade out features not available If txtName1.SelText = "" Then 'If not text is selected... mnuCut.Enabled = False 'not available mnuCopy.Enabled = False 'not available Else mnuCut.Enabled = True 'available of text is selected. mnuCopy.Enabled = True 'available if text is selected. End If If Clipboard.GetText() = "" Then 'If clipboard is empty... mnuPaste.Enabled = False 'not available Else mnuPaste.Enabled = True 'available if clipboard contains text End If End Sub
No Comments for this page.
You Must be
signed in
or a
member
to comment.
Code Stats
22,944
Views
0
Total Comments
0
Rating of 5 (
3
Votes)
Code Options
·
Login to Rate This Code
·
Login to Post a Comment
·
Read more by this author
Related
·
RGB Color Fader
·
Adder
·
Math Problems
·
Combo Box Colors
·
Flag Viewer
"AllSyntax.com" Copyright © 2002-2021; All rights lefted, all lefts righted.
Privacy Policy