Results 1 to 8 of 8

Thread: [RESOLVED] [2005] Progress Bar Created in a Module?

  1. #1

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    [RESOLVED] [2005] Progress Bar Created in a Module?

    I've found that asking one or two questions before I attempt something new prevents 10 questions later, so with that in mind: is it possible to create and update a progress bar from a module?

    I ask because the mass of calculating under the hood that I want get through occurs inside a module - it has nothing to do with the display, so I send a sub out to do it.

    Something makes me uneasy about idea, and I was wondering what experienced programmers do when this type of situation occurs.

    Thanx!
    Last edited by neef; Sep 11th, 2007 at 07:23 PM.
    Intermediate Level Programmer Extraordinaire

  2. #2
    Fanatic Member CodedFire's Avatar
    Join Date
    Aug 2007
    Location
    In Cog Neato
    Posts
    568

    Re: [2005] Progress Bar Created in a Module?

    Ive never tried it but the way i would approch this is to make a class that inherets the progress bar object, then add the calculation code. This would mean you would have the lot wrapped up in a nice little object.

    EDIT: I would just like to state this is how i would approch it im not sure if this is the best way as i have not needed to use progress bars yet.
    Languages: Visual Basic 05/08, C# 08
    IDE: Express Editions
    Framework: 2.0, 3.0, 3.5


    Lesson 5: Don't take domestic advice from perpetual singles. - Mendhak

  3. #3

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    Re: [2005] Progress Bar Created in a Module?

    That's not a bad idea at all; just mostly involves cut and pasting what I have and passing the correct info to the inherited class.
    Intermediate Level Programmer Extraordinaire

  4. #4
    Fanatic Member CodedFire's Avatar
    Join Date
    Aug 2007
    Location
    In Cog Neato
    Posts
    568

    Re: [2005] Progress Bar Created in a Module?

    More or less. Really a module is a type of class. So why use a type of class when you can use one itself. I would also try make it as generic as possible that way it becomes reusable. Maybe overload the functions that exept your data to cater for different data types.

    BTW: If robdog888 is looking, i finally found a good use for classes
    Languages: Visual Basic 05/08, C# 08
    IDE: Express Editions
    Framework: 2.0, 3.0, 3.5


    Lesson 5: Don't take domestic advice from perpetual singles. - Mendhak

  5. #5

    Thread Starter
    Hyperactive Member neef's Avatar
    Join Date
    Dec 2001
    Location
    Boston
    Posts
    311

    Re: [2005] Progress Bar Created in a Module?

    Just implemented this idea in my project and with some fiddling it works great! Thanks for your help CodedFire!
    Intermediate Level Programmer Extraordinaire

  6. #6
    Fanatic Member CodedFire's Avatar
    Join Date
    Aug 2007
    Location
    In Cog Neato
    Posts
    568

    Re: [RESOLVED] [2005] Progress Bar Created in a Module?

    Hey no problem!
    Languages: Visual Basic 05/08, C# 08
    IDE: Express Editions
    Framework: 2.0, 3.0, 3.5


    Lesson 5: Don't take domestic advice from perpetual singles. - Mendhak

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

    Re: [2005] Progress Bar Created in a Module?

    Quote Originally Posted by CodedFire
    i finally found a good use for classes
    No, you finally found a good use for inheritance. There's more to classes than just inheritance. In fact, classes and inheritance don't even have to go together because VB6 used classes but didn't support inheritance. Apart from that, every time you add a form to your project you're inheriting the Form class, so you've been using inheritance all along.
    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

  8. #8
    Fanatic Member CodedFire's Avatar
    Join Date
    Aug 2007
    Location
    In Cog Neato
    Posts
    568

    Re: [RESOLVED] [2005] Progress Bar Created in a Module?

    Thanks jmcilinney for raining on my parade

    Although you are correct. I am only implementing classes and all things OO into my projects. I was finding it difficul to understand a classes use over a module. But inheritance has really helped me understand one of the ways of class usage.

    Obviously ive been using all the features of basic OO since day one but trying to, i suppose understand it has been a bit awkward but im getting there.
    Languages: Visual Basic 05/08, C# 08
    IDE: Express Editions
    Framework: 2.0, 3.0, 3.5


    Lesson 5: Don't take domestic advice from perpetual singles. - Mendhak

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