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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Releaseing the Properties page values in Active-X Control

Status
Not open for further replies.

PankajAgr

Technical User
Jul 30, 2003
52
IN
Hi Guys,

I designed the one Active-X control. In this control I added the one tree view, Ms-FlecGrid and 4 Command buttons. I defined the two properties page for this control also.

when user put the Active-X control in form, through properties page user can define how many command buttons he want to visible in control(In design mode and in Run mode). By default all the command buttons will visible in control. Suppose user wants to visible only first command button then in properties page he marked first command button is visible = True and for other buttons he marked as Visible = False.

My problem is thet when first time put the control in the form (all the command buttons will be visible) and run the form (run mode) and close the form to come in design mode now all the command buttons are hidden. Whatever default values set in properties page will lost so all command buttons are hide.

When after running the form first time it release the default properties page values?

I want to know why control is not preserving the default values set in the properties page?

Thanks in Advance
Pankaj

In one properties page user can set wich command buttons he want display

Senior Software Engineer,
Infotech Enterprises Limited
Hyderabad, Andhra Pradesh, India.
URL :
 
What you are probably missing is the PropertyBag object for preserving property settings between design and runtime, and or between instances.
 
Yeah, I'm sure NoCoolHandle is right about that. You need to read up on propertybag object and propertychanged statement and so on.

It's important to recognize that the VB6 development environment actually creates an instance of your control. When you hit the run button, it destroys the design time instance, and creates a run time instance. When you stop the program, and go back into design time, it destroys the run time instance, and creates a design time instance. During these processes, various events are fired. If you change design time instance properties, if you want them to persist into the run time, you have to save the changes to the properties so that the run time instance will know what the changes are. That's what the property bag object is for.

HTH

Bob
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top