Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing label captions...not quite.
Message
From
26/07/2005 17:52:50
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
The Mere Mortals Framework
Title:
Changing label captions...not quite.
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01036044
Message ID:
01036044
Views:
46
This functionality does not seem to work, or at least, following the instructions in DEVGUIDE.DOC the farthest I can get is to see the label caption changed during the form session, as soon as I close the form, when opened again the original caption is back.

The only message that I could find was #434689, but no solutions were provided nor the originator followed up.

I figured out what was going on, though :

Let's suppose, that as explained in the user's manual, you set the This.cLabelControlSource property to "v_myview.myfieldcaption".

Then, the reason why the label caption dissapears when reopening the form, is that when the CControlContainer.INIT event runs (KCustCtl.vcx), the following line,
lcCaption = &lcControlSource
evaluates to empty.

Why is this? Well, while debugging this line, EOF('v_myview') evaluates to .T. and so seem to be the other tables/views in the forms dataenvironment.

Of course that if I run the CControlContainer.INIT event in the Activate event of the page that contains the control, I can make it work. This is because at that point the view record pointer is at the top of the cursor or at the record being edited,(I am using a form based on cbizobjmaintenanceform), but this is not a valid solution.

Any ideas are more than welcome. Thanks!

The following is part of the in for CControlContainer.INIT for better understanding.
IF NOT EMPTY(This.cLabelControlSource)   && 
	*-----------------------------------------------
	*--- Get the value of the ControlSource field
	*-----------------------------------------------
	lcControlSource = This.cLabelControlSource
	lcCaption = &lcControlSource
	*----------------------------------------------
	*--- If the default text has been overridden
	*--- (based on a non-empty field...
	*----------------------------------------------
	IF NOT EMPTY(lcCaption)
		*----------------------------
		*--- Set the label caption
		*----------------------------
		This.Label.Caption = ALLTR(lcCaption)
	ENDIF
ENDIF
Reply
Map
View

Click here to load this message in the networking platform