Results 1 to 5 of 5

Thread: Question about user controls.

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Question Question about user controls.

    Hello,

    I'm using user controls embedded in a tab control to do some file encryption/decryption.

    If I have the first tab with the folder path and files and the second tab with the progress, If I were to close them, would the information from the first tab be lost and would the overall progress stop?

    Thanks in advance!
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

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

    Re: Question about user controls.

    It depends exactly what you mean by "close". If a control gets disposed then it's handle is destroyed but that doesn't mean it ceases to exist. If said control is doing some work then that work will continue. That would be a poor design though, and it could lead to other problems.

    That said, why would a control be performing encryption? Controls are about user interaction. Any encryption should be passed off to some other object designed for that purpose. As for progress, a control could be used for displaying progress but it shouldn't be linked directly to the process whose progress is being displayed. You should simply be telling the control that it needs to display appropriate progress for a particular number. Where that number came from should not be any concern of the control.
    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
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Re: Question about user controls.

    Oh, no. Sorry. I explained myself pretty poorly. In the first tab the names of the files would be passed to encryption class (which will be handled on another thread) and will do that for each file, the second tab would have a progressbar to display the percent completed (total and the percent of the file).

    When I say close I mean the user removed the tab.
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

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

    Re: Question about user controls.

    In that case the controls have got nothing to do with the encryption so there's no reason that removing them would affect the encryption. If I turn on the TV and then leave the room, the TV doesn't care. Same thing.

    Obviously if you try to refer to those controls once they're removed, e.g. to set the progress, then you'll most likely have issues.
    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

  5. #5

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2008
    Location
    Dominican Republic
    Posts
    733

    Re: Question about user controls.

    Ok. I'll keep going. If I get stuck I'll come back. Thanks for the explanation.
    "In our profession, precision and perfection are not a dispensable luxury, but a simple necessity."
    Niklaus E. Wirth


    Rate any post that helped you, it's a good way of saying thanks
    Please specify your Visual Studio Version!

    Why rating is useful

    My Code Bank Submissions: How to determine Windows Version| Working With Mouse Events | Blocking Input Using API | Get host's IP | Minimize to system tray "animated" | Colored ListBox (custom fonts, colors, highlight) Updated -New Class! | [VS 2008] Strong encryption and hashing class - Updated! 31/August/2009 | Create a shortcut using IWshRuntimeLibrary

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