Results 1 to 5 of 5

Thread: Getting FileInfo

  1. #1

    Thread Starter
    Lively Member Iain Wicks's Avatar
    Join Date
    Jun 2005
    Location
    Tring, Hertfordshire
    Posts
    88

    Getting FileInfo

    If I want to get file info from a file called by a dialog box, I can use

    VB Code:
    1. Dim File As FileInfo = = New FileInfo(ofdImage.FileName)
    No Problem.
    What about if i want to get the same info from a picturebox.image because there doesn't seem to be a picturebox.filename property.

    Thanks

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

    Re: Getting FileInfo

    The image in a PictureBox is an Image object and has no specific connection to a file. The image itself may not even have come from a file. It may have been loaded from a resource, or drawn manually in code. If you want to know what file an image was loaded from then it's up to you to remember it at the point that the file is opened and the Image created. If you don't do so then that information is lost because it is not automatically stored anywhere.
    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

  3. #3

    Thread Starter
    Lively Member Iain Wicks's Avatar
    Join Date
    Jun 2005
    Location
    Tring, Hertfordshire
    Posts
    88

    Re: Getting FileInfo

    Wow, that was a quick response.

    Thanks for the tip!!

  4. #4
    Frenzied Member Phill64's Avatar
    Join Date
    Jul 2005
    Location
    Queensland, Australia
    Posts
    1,201

    Re: Getting FileInfo

    Quote Originally Posted by Iain Wicks
    Wow, that was a quick response.

    Thanks for the tip!!
    abusing that F5 button again Jm?

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

    Re: Getting FileInfo

    Quote Originally Posted by Phill64
    abusing that F5 button again Jm?
    I think I'm being rather restrained. I'm subscribed to fewer than half the threads on the front page. If it gets above 50% I have to call my sponsor. One day at a time...
    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