Results 1 to 7 of 7

Thread: Menu Editor in VB

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Location
    India
    Posts
    4

    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

  2. #2

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Location
    India
    Posts
    4

    Re: Menu Editor in VB

    ??????????/

  3. #3
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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

  4. #4
    PowerPoster Jenner's Avatar
    Join Date
    Jan 2008
    Location
    Mentor, OH
    Posts
    3,712

    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.
    My CodeBank Submissions: TETRIS using VB.NET2010 and XNA4.0, Strong Encryption Class, Hardware ID Information Class, Generic .NET Data Provider Class, Lambda Function Example, Lat/Long to UTM Conversion Class, Audio Class using BASS.DLL

    Remember to RATE the people who helped you and mark your forum RESOLVED when you're done!

    "Two things are infinite: the universe and human stupidity; and I'm not sure about the universe. "
    - Albert Einstein

  5. #5
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    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.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

  6. #6

    Thread Starter
    New Member
    Join Date
    Jan 2009
    Location
    India
    Posts
    4

    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

  7. #7
    PowerPoster gep13's Avatar
    Join Date
    Nov 2004
    Location
    The Granite City
    Posts
    21,963

    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
  •  



Click Here to Expand Forum to Full Width