Results 1 to 3 of 3

Thread: Only filename in form

  1. #1

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Talking Only filename in form

    Well I made a proggie that opens a file. But I want it say the filename at the top of the form when I opened it so I did this:

    Code:
    this.Text = "Map Reader ~ " + ofd.FileName;
    However, this gives the whole filename. For example, instead of 'C://Program Files/Grandma/kids.exe' I want kids.exe

    I usta know the code but I lost it. If you can, please include the whole code instead of saying something like use an array because I hardly even know what an array is

  2. #2

    Thread Starter
    Frenzied Member
    Join Date
    Mar 2006
    Location
    Pennsylvania
    Posts
    1,069

    Re: Only filename in form

    nevermind I got it..

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

    Re: Only filename in form

    You didn't say what you did to solve the problem so we don't know if you used the best method. The most appropriate would be to use the System.IO.Path.GetFileName method.
    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

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