Results 1 to 7 of 7

Thread: How to Link a folder and file with Button/Menu List

  1. #1
    rajkumar.shukla is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Feb 2015
    Posts
    8
    Reputation
    0

    How to Link a folder and file with Button/Menu List

    Hi Experts,

    I'm very new to VB.net. I'm making a form in VB.net. in that form I create a button and a menu list. I want to attach folder with button and PDF/MS word file with menu list.

    when I click on the button my attached folder will open in that event and when I click on the menu list my attached file will open.

    Hope I'm clear with my question.

    Waiting for a expert reply on that.

  2. #2
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,801
    Reputation
    1705
    For the menu items, you can store the file path in Tag property. You can then use a single method to handle the Click event for all menu items. In the event handler, the `sender` is the menu item that was clicked so you can get the file path from its Tag property and open it. For the Button, you could do the same but, if there's only one Button, you may as well just use a separate variable to store the folder path. In both cases, a call to Process.Start will do the opening.

  3. #3
    rajkumar.shukla is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Feb 2015
    Posts
    8
    Reputation
    0
    Thanx, jmcilhinney. Could you guide me the way to enter the code with a complete step. Thanx for your help

  4. #4
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,801
    Reputation
    1705
    How about, instead of that, you use the information I've already provided to make an attempt for yourself? If you run into issues then post back and show us what you've done so far and where the issue is.

  5. #5
    rajkumar.shukla is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Feb 2015
    Posts
    8
    Reputation
    0
    Hi, I've attached a snapshot of the problem. plz correct it.Problem.jpg

  6. #6
    jmcilhinney's Avatar
    jmcilhinney is offline VB.NET Forum Moderator
    .NET Framework
    .NET 4.0
    Join Date
    Aug 2004
    Location
    Sydney, Australia
    Posts
    13,801
    Reputation
    1705
    That's nothing really to do with your original question. The error message makes it plain what the issue is there.

  7. #7
    rajkumar.shukla is offline VB.NET Forum Newbie
    .NET Framework
    .NET 4.0
    Join Date
    Feb 2015
    Posts
    8
    Reputation
    0
    thanx its working fine now

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •