Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Marcia Akins
  Where is Marcia Akins?
 Ohio - United States
 Marcia Akins
 To: Muhammad Zahid
  Where is Muhammad Zahid?
 Muhammad Zahid
Subject: RE: Using Status Bar
Thread ID: 188651 Message ID: 188916 # Views: 5 # Ratings: 0
Version: Visual FoxPro 9 Category: Forms
Date: Tuesday, August 12, 2008 3:49:18 PM         

I am working on a form and want to use status bar (OLE control) on bottom of form but there is no help available for this. I want to display the (CAPS,NUM,INS) on off status in its panels. please help me to design this.

The status bar ActiveX control is another of the controls contained in the common controls library MSComctl.ocx and is described in detail in the associated help file CmCtl198.chm. The control can be used to give a form the standard ‘windows style’ paneled status bar

As with all the other ActiveX controls that we have discussed in this chapter, the first thing we did was to create a sub class of the control (see the xsba class in CH09.vcx). The location of the status bar on the form is controlled by its Align property and it can be displayed at the top, left, right, or, more conventionally, across the bottom of a form. The default value for this property is 0 (None) so in our sub class we explicitly set it to 2 (Bottom). The control is a container for “panel” objects which can be displayed in one of two ways, controlled by a Style property.
• Style = 1 (Simple) defines a single, full width, panel that can display only the text specified by its SimpleText property. Nothing else can be displayed in this style.
• Style = 0 (Multiple Panels) activates the Panels collection which allows for up to sixteen separate panels to be defined, and whose allowable contents are controlled by their individual Style properties.

The status Panels collection conforms to the standard ActiveX model and has Count property to track the number of panels. You can use either the Index or the Key property to access contained panel objects. The PanelClick() event receives, as a parameter, an object reference to the panel over which a mouse click was detected and so can be used to change either the appearance or contents of the control at run time if required. The panel objects have a set of properties as described below:

Property Type Comments
Alignment Numeric 0 = Left, 1 = Center, 2 = Right
AutoSize Numeric 0 =None, 1= Spring, 2 = Contents
Note: “Spring” means that any remaining space after fixed, and contents panels have been defined, is shared equally between all panels with that setting. At least one panel should always be defined with this setting to ensure proper display.
Bevel Numeric 0 =None, 1= Inset, 2 = Raised
Enabled Logical
Index Numeric Panels Collection index number
Key Character Panels Collection key string
Left Numeric Left position inside the Status Bar in Pixels
MinWidth Numeric Minimum Width for the panel in Pixels (Default = 10)
Picture Character Name of the picture to display in the panel (no control over location)
Style Numeric Panel Contents
0 = Text (read from Text Property)
1 = Caps Key Setting
2 = Num Lock Key Setting
3 = Insert Key Setting
4 = Scroll Lock Key Setting
5 = System Clock
6 = System Date
7 = Kana Lock Setting (Japanese Operating Systems only)
Tag Character Additional data store – not used natively by the control
Text Character Text to display
ToolTipText Character Tooltip Text to display
Visible Logical
Width Numeric Actual panel width, in pixels

There is one, rather peculiar, bug with this control. If your form is defined as a ‘Top Level’ Form (i.e. ShowWindow =2) the drag bars for sizing the form which are normally shown at right of the status bar simply disappear when the form is run.

Marcia G. Akins
Tightline Computers, Inc.


Using Status Bar Posted by Muhammad Zahid @ 8/11/2008 10:22:38 AM
RE: Using Status Bar Posted by surinder singh @ 8/11/2008 10:30:19 AM
RE: Using Status Bar Posted by Carlos Alloatti @ 8/11/2008 3:19:25 PM
RE: Using Status Bar Posted by Muhammad Zahid @ 8/12/2008 7:16:29 AM
RE: Using Status Bar Posted by Marcia Akins @ 8/12/2008 3:49:18 PM
RE: Using Status Bar Posted by Yousfi Benameur @ 8/12/2008 10:22:09 PM