Results 1 to 3 of 3

Thread: Modularizing!

  1. #1

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Posts
    2

    Angry

    I am currently writing a client application (a chat program) and have a status bar at the bottom that gives you your connection status ... somewhat similar to yahoo messenger ... yellow when connecting, and green when connected. The code I have to do this is

    StatusBar.Panels(1).Picture = LoadPucture(" ....\PATH")
    StatusBar.Panels(1).Text = "Connecting"

    I want to modularize this so instead of all this code I could just have something like SB1.connecting() and have the statusBar show up with the connecting image (yellow image). I am very new to VB and any help I could get would be greatly appreciated. Thank you.

    Dhiren

  2. #2
    Member
    Join Date
    Oct 2000
    Location
    Texas
    Posts
    37
    I haven't tested what it is you are doing, but here is how you would set it up:

    1) Add a Standard Module to your project

    2) Add a public procedure to the module:

    Public Sub ShowConnecting(ByVal SB1 As StatusBar)

    With SB1
    .Panels(1).Picture = LoadPicture(" ....\PATH")
    .Panels(1).Text = "Connecting"
    End With

    End Sub

    3) In the code that keeps track of what is going on, update the status bar by calling the procedure in the module and passing the name of your status bar:

    ShowConnecting SB1

    4) Create one procedure for each "look" you want and call them according to what's going on.
    If at first you don't succeed...

  3. #3

    Thread Starter
    New Member
    Join Date
    Apr 2001
    Posts
    2

    Thumbs up asdf

    Hey thanks for your input ... it worked.

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