|
-
Feb 5th, 2009, 08:19 AM
#1
Thread Starter
New Member
Menu Editor in VB
Iam a beginner to Visual Basic.I have only created the menu items.Can u plz show the code for open and copy?
Many Thanks
-
Feb 5th, 2009, 08:25 AM
#2
Thread Starter
New Member
-
Feb 5th, 2009, 08:26 AM
#3
Re: Menu Editor in VB
Hello there,
I think you are going to need to provide some more information before anyone is going to be able to help you!!
What are you trying to open and what are you trying to copy?!?
Can you provide some code that you already have, or maybe some screen shots, as well as an explanation as to what it is your application is meant to do.
Gary
-
Feb 5th, 2009, 08:26 AM
#4
Re: Menu Editor in VB
This works pretty well:
Code:
Dim c As Control = GetFocusedControl()
If Not c Is Nothing AndAlso TypeOf c Is TextBoxBase Then
DirectCast(c, TextBoxBase).Cut()
End If
Replace "Cut()" with "Copy()" and "Paste()" for those.
-
Feb 5th, 2009, 08:29 AM
#5
Re: Menu Editor in VB
There is no specific code. It depends exactly what it is that you want to open and what you want to copy.
Generally you'd want to display an OpenFileDialog if you want the user to open a file, but how you configure it depends exactly what type of file you want to open. You should start by reading about the OpenFileDialog.
For copying you might want to call the Copy method of the TextBox or RichTextBox that currently has focus, assuming that you want to copy text from such a control. Again, the details will depend on your specific application.
-
Feb 5th, 2009, 08:31 AM
#6
Thread Starter
New Member
Re: Menu Editor in VB
When I click on open menu item a msg box with all existing files should open.When I select a text in a text box and select copy menu item then it must be copied to the clipboard
-
Feb 5th, 2009, 08:33 AM
#7
Re: Menu Editor in VB
Hello,
In which case, both of those things have been answered for you in the posts above.
Use the OpenFileDialog, see post #5, which provides dialog which can browse the entire hard drive(s), and post #4 explains how to use cut, copy and paste.
Gary
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|