StatusBar Problem????

In this category you can exchange your programming questions and solutions.
Post Reply
Darren
Posts: 63
Joined: Wed May 11, 2011 11:55 am

StatusBar Problem????

Post: # 1168Post Darren
Mon Jan 20, 2014 12:39 pm

Please refer to the code shown below........

OBJECT MainForm As Form
  Left=247
  Top=118
  Caption="New Form"
  ClientHeight=383
  ClientWidth=684
  OBJECT StatusBar1 As StatusBar
    Width=1000
    Height=19
    AddPanel
    PanelWidth(0)=MainForm.Width-265
    PanelText(0)=""
    AddPanel
    PanelWidth(1)=125
    PanelText(1)="Darren James Smith"
    SimplePanel=False
    AddPanel
    PanelWidth(2)=140
    PanelText(2)="Build Date 20-01-2014"
    SimplePanel=False
  END OBJECT
  OBJECT Button1 AS Button
    Left=144
    Top=144
    Width=75
    Height=25
    Caption="Test"
    TabOrder=1
    OnClick=Button1_Click()
  END OBJECT `{Button1}
END OBJECT `{MainForm}

Dim TempString As String

MainForm.ShowModal

Sub Button1_Click()
    TempString = "HELLO"

    UpdateStatusPanel

    Run ("C:MechToolsConfigure.exe", SW_ShowNormal)

    TempString = "GOODBYE!!!"

    UpdateStatusPanel
End Sub

Sub UpdateStatusPanel()
    StatusBar1.PanelText(0) = TempString
End Sub

I am trying to do the following (the above is a test only!)

1] CLICK THE BUTTON AND THE STATUS BAR SHOULD DISPLAY "HELLO"

2] RUN A PROGRAM AND WAIT FOR IT TO FINISH (END)

3) THE STATUS BAR SHOULD THEN DISPLAY "GOODBYE!!!"

However,

The StatusBar does not show the word "HELLO" before it runs the program

Does anybody know what I am doing wrong???

You will have to change the text:-

Run ("C:MechToolsConfigure.exe", SW_ShowNormal)

To suit your exe file (Eg NotePad.exe)


Many thanks in advance!!!!

Darren

PaPi
Posts: 114
Joined: Wed May 16, 2007 11:55 am

StatusBar Problem????

Post: # 1169Post PaPi
Thu Jan 23, 2014 8:58 pm

Darren,

? ?But it certainly SHOWS the StatusBar the word "HELLO" before it runs the program. Try to modify the program to:

Sub Button1_Click()
? ? TempString = "HELLO"

? ? UpdateStatusPanel

` and TRY THIS:
showmessage "stop"

? ? Run ("C:MechToolsConfigure.exe", SW_ShowNormal)

? ? TempString = "GOODBYE!!!"

? ? UpdateStatusPanel
End Sub


PaPi

Marco
Site Admin
Posts: 246
Joined: Sat Sep 15, 2018 8:41 pm

StatusBar Problem????

Post: # 1170Post Marco
Fri Jan 24, 2014 4:22 pm

You can do also something like this:

Sub Button1_Click()
    TempString = "HELLO"
    UpdateStatusPanel
``==== adding these lines will do also
mainform.repaint
sleep 500
``==========================
    Run ("C:WindowsSystem32NotePad.exe", SW_ShowNormal)
    TempString = "GOODBYE!!!"
    UpdateStatusPanel
End Sub

Post Reply