Classes?

HI All

I have created my first simple desktop app with one window. I have then added a container control to my project and set its background to green.

I have dropped this green container onto my window.

Super!

Now if I go and change my container to background yellow I thought the one I dropped onto the window would also change colour but it doesn’t.

How to I create a “Container Class?” so that I can design it once and use it many.

THanks

Chris.

It should, so something is missing from your description.

Check the background color property of the container on the window.

Chances are because you dragged the instance on the window BEFORE changing the color. The instance on the window has that color saved. If you want to overwrite this property EVERYWHERE you use the class, implement the Open event of the container and set the background color property in there.

Cheers Brock, so anything that I want to be inherited has to be in code?

Kind of, because it’s an instance property you can control in the properties pane (on the right side) - each instance gets those settings saved with it once you add the instance to a window or other container control. That means it wont update if you edit the base control its derived from, but new instances dragged out will have this updated property.

[quote=201181:@Chris Davis]I have created my first simple desktop app with one window. I have then added a container control to my project and set its background to green.

I have dropped this green container onto my window.

Super!

Now if I go and change my container to background yellow I thought the one I dropped onto the window would also change colour but it doesn’t.[/quote]

Just toggle “Custom Color” to On in the ContainerControl inspector.

[quote=201181:@Chris Davis]How to I create a “Container Class?” so that I can design it once and use it many.
[/quote]

Make a Subclass of ContainerControl, add your code to it and make instances of the subclass.

Thanks Brock all working now.