is it possible to open a textfile1.txt through the menu strip?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • negus
    New Member
    • Jan 2010
    • 18

    is it possible to open a textfile1.txt through the menu strip?

    i have a menu strip on my form and i am creating log in ID's and PW's for a application. and i want the users to be able to see all of the different logins for the app.

    so i created a new item and it is a textfile. i am wondering how do i open or show the textfile when the login is clicked through the menustrip.

    is that at all possible and if not is there a way for me to do it through a button?

    thanks for the help in advance
  • vb5prgrmr
    Recognized Expert Contributor
    • Oct 2009
    • 305

    #2
    You can open a file with any event you want. When you create your menu items, you can access their procedures by selecting the menu item you want code for from the form design view. It will automatically take you to the code window, just as if you had double clicked on a command button.

    So then, all you need to do to open up the file is to read up on the following in VB's help...

    FreeFile Function
    Open Statement
    Input or Line Input Functions
    Close Statement



    Good Luck

    Comment

    • negus
      New Member
      • Jan 2010
      • 18

      #3
      yeah i understand the double click to get the sub on clickeven of the menu strip i tried the codes that should have worked to my knowledge and it failed.

      but i just made a new form instead of a textfile a dialog box. and got it to work now. thanks for your help!

      Comment

      Working...