Results 1 to 6 of 6

Thread: [1.0/1.1] Displaying a status message when a file is downloading

  1. #1

    Thread Starter
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    [1.0/1.1] Displaying a status message when a file is downloading

    Hi. I have a situation where a file is downloading from a ftp server. All of that is working properly its just that when the file is downloading, I want to display like a form to the user saying: 'File is downloading' and when the file finishes download remove the form with the message automatically. I tried the messagebox but it required the user to click the OK button. Is there any way I could achieve this?

    Jennifer

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

    Re: [1.0/1.1] Displaying a status message when a file is downloading

    You're going to want to display this message form modally, which means that the calling form can't do anything else while it's displayed. Your best bet is to have your main form display a modal dialogue and then have that dialogue download the file. Once the file finishes downloading the form can dismiss itself by setting its DialogResult to OK. If you want your UI to remain responsive while the file is being downloaded, e.g. the message form will redraw itself if another window is dragged over it, then you'll need to use a worker thread to download the file. That will also allow you to provide a Cancel button on the message dialogue if you want to.
    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
    Hyperactive Member drattansingh's Avatar
    Join Date
    Sep 2005
    Posts
    395

    Re: [1.0/1.1] Displaying a status message when a file is downloading

    Sorry if this is a novice question but what is: a modal dialogue?

  4. #4
    I'm about to be a PowerPoster! mendhak's Avatar
    Join Date
    Feb 2002
    Location
    Ulaan Baator GooGoo: Frog
    Posts
    38,170

    Re: [1.0/1.1] Displaying a status message when a file is downloading

    A modal dialog is something like the alert() on a web page. It steals all the focus from the application and you cannot touch the application until the modal dialog is removed. Which means that once the progress bar reaches 100%, you can unload the modal dialog and the user can return to the application.

  5. #5
    Arabic Poster ComputerJy's Avatar
    Join Date
    Nov 2005
    Location
    Happily misplaced
    Posts
    2,513

    Re: [1.0/1.1] Displaying a status message when a file is downloading

    Quote Originally Posted by JenniferBabe
    Sorry if this is a novice question but what is: a modal dialogue?
    Just like the "MessageBox" and any dialog you display using "ShowDialog();"
    "I'm not normally a praying man, but if you're up there, save me... Superman!" - Homer Simpson
    My Blog

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

    Re: [1.0/1.1] Displaying a status message when a file is downloading

    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