Below is a little StatusMessage program which I picked up and modified ... the intent is to provide a little form in the middle of the screen during long operations to deceive the user into thinking that the computer is actually doing something.
However, when called, the form doesn't always show immediately; or, it shows just the outline and not the label inside, so it looks like just a simple transparent box.
Any ideas for changes at the end of the program, after it's all been created, to insure that it displays properly?
TIA,
James (Jim) Nelson
Parameters gcPrompt, lnXCenter, lnYCenter
If Not Empty(gcPrompt)
Release goPausing
Public goPausing
Local loTopLevelForm
loTopLevelForm = GetTopLevelForm()
goPausing = Createobject("ShowWindow1")
If loTopLevelForm.ShowWindow # 2
If Not _Screen.Visible
_Screen.Visible=.T.
goPausing.HideScreen = .T.
Endif
Endif
With goPausing
.WindowType = 0
.Height = 36
.Width = 134
.Caption = ""
.Name = "pauser"
.TitleBar = 0
.AddObject('myLabel','Label')
With .myLabel
.FontBold = .T.
.FontSize = 9
.Left = 20
.Top = 10
.Width = 20
.Name = "myLabel"
.ForeColor = Rgb(255,0,0)
.BackStyle = 0
.Caption = gcPrompt
.AutoSize = .T.
.Visible = .T.
Endwith
.Width=.myLabel.Width+40
.myLabel.Left = (.Width - .myLabel.Width)/2
If Pcount() >= 3
.Left = lnXCenter - .Width / 2
.Top = lnYCenter - .Height / 2
Else
.AutoCenter = .T.
Endif
.Show
.Refresh
Endwith
Else
If "O"=Vartype("goPausing") And goPausing.HideScreen
_Screen.Visible=.F.
Endif
Release goPausing
Endif
Return
Define Class ShowWindow1 As Form
ShowWindow = 1
HideScreen = .F.
Enddefine
Jim Nelson
Newbury Park, CA