Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Changing a property at runtime
Message
From
13/11/2004 10:30:48
 
 
To
12/11/2004 17:38:11
Hilmar Zonneveld
Independent Consultant
Cochabamba, Bolivia
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Environment versions
Visual FoxPro:
VFP 7 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
00961048
Message ID:
00961155
Views:
25
>The name is one of the few properties you can't change. Why would you need to change that one?

Thanks for answering, my stimated Hilmar.

The reason is that I want to change my buttons for an image control class dinamically. In order to do that, I made button invisible, and copy button visible properties (width, height, top, left) to image control. You can see two problems in this approach: 1)When user clicks on the image control it must performs command click method, and 2)When another control reffers to command properties such as Enabled, Visible or so, changes must be applied to image, instead.

I solved the first problem in that way. a)setting Command.Visible = .F. b)storing name of button in an Image control property, c)calling Command.Click from Image.Clik throuhg stored name of commanbutton.

The second problem is the big one. If another control has a "Command1.Enabled = .F." changes must be applied to image, not command. The solution that came to my mind was to assign Command.Name to Image control and change Command.Name. It works partially. I mean, if command is simply on a form or into a container on a form, it really works. But, if command in on a container IN A CLASS, and that class in on a form, doesn't work. So, second problem is still arise.

Can you see now?
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform