Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

OLE control MSComctlLib.SBarCtrl.2

Status
Not open for further replies.

mstrcmtr

Programmer
Nov 14, 2007
103
PK
Form has following OLE control MSComctlLib.SBarCtrl.2

This control used for showing No of records etc. at the bottom of form

On Some systems who have Microsoft office 2010,2013,2016 other then MS Office 2007 are giving Error due this control on running this form



 
MSComctlLib.SBarCtrl.2 is a status bar control. Do you have any strong reasons for using this? VFP has a native status bar which can display the current record number and the number of records (or anything else you like). Or you can easily create a form that simulates a status bar, and can display any information at all.

Or, if you want to show the number of records on the form itself, then just add a label and set its caption to RECCOUNT().

It's always questionable to use an OLE control when the features you need are built into VFP.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Hm, I thought I had posted already.

But to say in short:

Your setup should include the MS Common Controls OCX
and replacing the status bar usage with the native VFP status bar means SET STATUS BAR ON and then using SET MESSAGE TO or setting the statusbar property values of any control to display, well, a status bar text almost like a tooltip text, just when you set focus to a control.

You don't have a status bar in normal forms, then, though, not even sure if you can have a status bar per top level form or only the _SCREEN status bar.

Bye, Olaf.
 
Olaf said:
You don't have a status bar in normal forms,

True, but you can get the same effect by placing a shape or a container along the bottom of the form, and filling it with labels or other controls that display the information that you want to show. You should be able to use that to display just about anything that the OLE control can handle (except perhaps the current state of Num Lock, Caps Lock, etc.)

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

Visual FoxPro articles, tips and downloads
 
Using an OCX for displaying the current table and record is way over the top, as a simple 1-liner will do for reaching this goal with VFP code.

As Mike already wrote... All you have to do is placing a label on the form and filling it via timer, Form.Refresh, whatever.

Code:
Thisform.lblCursorInfo.Caption = ALIAS( SELECT() ) + [: ] + TRANSFORM( RECNO() ) + [ / ] + TRANSFORM( RECCOUNT() )

As less OCX you use in your app, as better will be you app's reliability.

-Tom
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top