Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Object invisible at runtime
Message
From
21/10/2010 19:06:03
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Object invisible at runtime
Environment versions
Visual FoxPro:
VFP 9 SP2
Miscellaneous
Thread ID:
01486572
Message ID:
01486572
Views:
123
I have this solved - for now. But since I don't know WTF is going on, the problem may re-appear.

A ComboBox becomes invisible at runtime under certain circumstances. I want it to be visible.

If, in Combo1.Init() [this is not the final name, just for testing purposes] I add:
This.AddProperty("SomeProperty")
the ComboBox becomes invisible. If I change that to:
ADDPROPERTY(This, "SomeProperty")
then it is visible, as expected. I originally used another property; A TRY/CATCH reveals no error in either case. The debugger shows that Combo1.Visible = .T., but it is still invisible. Also, this didn't happen before, on the same form. The property is not used anywhere else (I originally used another property name, but changed this to "SomeProperty" for testing purposes).

I would expect to merely need the single This.AddProperty() command; but I included some more code for testing purposes:
DODEFAULT()
LOCAL llError
TRY 
	This.AddProperty("SomeProperty")
	* ADDPROPERTY(This, "SomeProperty")
CATCH
	llError = .T.
FINALLY

ENDTRY
MESSAGEBOX(IIF(llError, "There was an error", "NO error"))
RETURN .T.
The message "NO error" is shown, but the ComboBox is still invisible.
Difference in opinions hath cost many millions of lives: for instance, whether flesh be bread, or bread be flesh; whether whistling be a vice or a virtue; whether it be better to kiss a post, or throw it into the fire... (from Gulliver's Travels)
Next
Reply
Map
View

Click here to load this message in the networking platform