Results 1 to 2 of 2

Thread: Changing A Label's Test

  1. #1

    Thread Starter
    New Member
    Join Date
    Jan 2000
    Posts
    4

    Post

    I am working on a project that requires me to have a label and a progress bar on one form. I have the same progress bar run 11 times, each calling in a different time in it's on DIM'ed variable:

    Dim Workarea1(32000) as String

    Everytime the progress bar restarts, I want it to change the caption of the label to whatever I want. I tried using this in a case structure and was unsuccessful. The caption is set to "Initializing..." at form load and there is nothing in the caption field on the properties box. Please help.

    ------------------
    Adam Hughes (SimGuy)
    [email protected]
    ICQ #: 19335996
    http://www.simcityhq.com/simport

  2. #2
    Member
    Join Date
    Jul 1999
    Location
    J-ville, NC
    Posts
    54

    Post

    This is a lot of code and if anyone else can simplify it, be my guest....

    Code:
    Private Sub Command1_Click()
    Dim Counter As Integer
    Dim Workarea1(3200) As String
    Dim Workarea2(3200) As String
    Dim Workarea3(3200) As String
    Dim Workarea4(3200) As String
    Dim Workarea5(3200) As String
    Dim Workarea6(3200) As String
    Dim Workarea7(3200) As String
    Dim Workarea8(3200) As String
    Dim Workarea9(3200) As String
    Dim Workarea10(3200) As String
    Dim Workarea11(3200) As String
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea1)
    ProgressBar1.Max = UBound(Workarea1)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea1) To UBound(Workarea1)
    Workarea1(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption1"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea2)
    ProgressBar1.Max = UBound(Workarea2)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea2) To UBound(Workarea2)
    Workarea2(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption2"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea3)
    ProgressBar1.Max = UBound(Workarea3)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea3) To UBound(Workarea3)
    Workarea3(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption3"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea4)
    ProgressBar1.Max = UBound(Workarea4)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea4) To UBound(Workarea4)
    Workarea4(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption4"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea5)
    ProgressBar1.Max = UBound(Workarea5)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea5) To UBound(Workarea5)
    Workarea5(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption5"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea6)
    ProgressBar1.Max = UBound(Workarea6)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea6) To UBound(Workarea6)
    Workarea6(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption6"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea7)
    ProgressBar1.Max = UBound(Workarea7)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea7) To UBound(Workarea7)
    Workarea7(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption7"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea8)
    ProgressBar1.Max = UBound(Workarea8)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea8) To UBound(Workarea8)
    Workarea8(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption8"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea9)
    ProgressBar1.Max = UBound(Workarea9)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea9) To UBound(Workarea9)
    Workarea9(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption9"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea10)
    ProgressBar1.Max = UBound(Workarea10)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea10) To UBound(Workarea10)
    Workarea10(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption10"
    ' ======================================================
    ProgressBar1.Min = LBound(Workarea11)
    ProgressBar1.Max = UBound(Workarea11)
    ProgressBar1.value = ProgressBar1.Min
    For Counter = LBound(Workarea11) To UBound(Workarea11)
    Workarea11(Counter) = Counter
    ProgressBar1.value = Counter
    Next Counter
    ProgressBar1.value = frmSave.ProgressBar1.Min
    DoEvents
    Label1.Caption = "Your Caption11"
    End Sub
    ------------------
    David Underwood
    Teen Programmer

    ICQ - 14028049
    E-mail - [email protected]



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