Inspector Behavior : custom button «caption» property

Hi everybody!

I’m trying to create a custom kind of button with a ContainerControl. This container has a label control «stCaption»

I added a computed property named «caption»

[code]Get :
Return stCaption.Text

Set :
stCaption.Text = value
[/code]

First of all, is it a good method?

Then, I added the caption property in the Inspector Behavior, it appears correctly and when I set the caption, I would like the text to appear in the button, in the IDE. How can I do?

You will not be able to see this in the IDE. This is a limitation of the IDE that changes in the new control you create will not be displayed in the IDE.

You will, however, see them at run-time.

So… impossible to create my own control?

It’s not impossible. It’s just that the use cant render your control changes. That would require compiling the Xojo code in your control to know what you expect it to look like.

No. Xojo gives you a great place to create your own controls.

It is just that you cannot see the results of changing properties in the IDE. So, in your example, changing the Caption property in the IDE will not dynamically change it in the IDE but you will see the value that you placed in the IDE when you run the program.

Ok, this answers my question… Thanks everybody!