Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Microsoft's StatusBar control.
Message
 
To
27/04/2005 17:37:08
General information
Forum:
Visual FoxPro
Category:
ActiveX controls in VFP
Environment versions
Visual FoxPro:
VFP 8 SP1
OS:
Windows XP SP2
Miscellaneous
Thread ID:
01009026
Message ID:
01009061
Views:
17
>Hi all,
>
>I am attempting to add the MS Statusbar control (from MSComCtlLib) to a form. But when I build the App and run it, the StatusBar does not appear. It is there, and in the right place, but is invisible. The Visible and Enabled properties are both true.
>
>I looked at the sample in VFP Solutions, and my settings are the same as it. And the status bar in the Solution appears.
>
>Does any one have any suggestion as to what I am do wrong?
>
>Greg

Heres some classes I use - note it resides in a container
* This is the container
DEFINE CLASS cntStatusBarClass as Container
style=3
left=0
height=34
top=0
visible=
t.
ENDDEFINE &&CLASS cntToolBarClass as Container

* This is the staus bar
define class ocxStatusBarCLass as Olecontrol
style=1
align=0
enddefine &&class ocxStatusBarCLass as Olecontrol

* This function is called by the form's init to put it at bottom of form
procedure AddStatusBar(oForm)
oForm.AddObject('CSB','cntStatusBarClass')
with oForm.CSB
.BorderWidth=0
.height=24
.SpecialEffect=2 && 2
.top=oForm.Height-24
.width=oform.width
.AddObject('SB','ocxStatusBarClass','COMCTL.SBarCtrl.1') &&'MSComctlLib.SBarCtrl.2')
.SB.Left=2 && oForm.Width-344
.SB.Top=2
.SB.Height=20
.SB.Width=oForm.CSB.width-4
.SB.Font.Size=8
.SB.panels(1).Key=[STATUS]
.SB.panels(1).Width=oform.CSB.width-250
*.SB.panels([STATUS]).Text=oform.caption
.SB.panels.add(,[TIME],,5,) &&oForm.IL.ListImages([CLOCK]).picture)
.SB.Panels([TIME]).Alignment=2 && sbrRight
.SB.Panels([TIME]).width=60
.SB.panels.add(,[DATE],,6,) 
.SB.Panels([DATE]).Alignment=2 && sbrRight
.SB.Panels([DATE]).width=60
.SB.panels.add(,[CAP],,1,) 
.SB.Panels([CAP]).Alignment=2 && sbrRight
.SB.Panels([CAP]).width=40
.SB.panels.add(,[NUM],,2,) 
.SB.Panels([NUM]).Alignment=2 && sbrRight
.SB.Panels([NUM]).width=40
.SB.panels.add(,[INS],,3,) 
.SB.Panels([INS]).Alignment=2 && sbrRight
.SB.Panels([INS]).width=40
.Visible=.t.
.SB.Visible=.t.
endwith
endproc

* This is the form's init
PROCEDURE MyForm_Init(oform)
AddStatusBar(oform) && Objects
ENDPROC &&MyForm_Init

* This is the form's resize
PROCEDURE MyForm_Resize(oform)
WITH oform
.CSB.width=.width
.CSB.top=.Height-24
.CSB.SB.Width=.width
.CSB.SB.panels(1).Width=.width-250
ENDWITH &&oform
ENDPROC &&MyForm_Resize
You would need to assure the form does not minimize below the tolerances of the status bar. With this guy, settin the forms minwidth to 275 seems to be the smallest it can get!
Imagination is more important than knowledge
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform