I would like to create a new shape similar to: Telerik.WinControls.RoundRectShape but with more roundness on the edges.
What is the best way to do this without using the shape editor because I am having trouble getting all the edges to mirror each other.
3 Answers, 1 is accepted
0
Mike
Telerik team
answered on 17 Jan 2007, 11:26 AM
Hello Bryan,
You can create you own programmatic shape by just deriving your class from Telerik.WinControls.ElementShape class. But let me first say that the RoundRectShape roundness can be adjusted. If you are using the Visual Style Builder (VSB) application you can specify the edge radius, typing the following, for example, for the value of the Shape prop:
Telerik.WinControls.RoundRectShape|20
The "|" stands for a property value separator and the number "20" for the radius value.
Using this code, the shape radius parameter can be passed on the constructor. Using design time you can specify the property Radius of the shape object.
Here is also some info about custom shapes in the VSB application. Currently the VSB would not allow you to select from a list with custom shapes, because it only loads shape types found in the Telerik.* assemblies. We are working on improving this functionality and in case of anyone is interested, we can discuss it.
Yes, changing the value like you specified below does do exactly what I wanted however, when i change the value in desgin time, the design time editor changes but does not stick... or rather at runtime goes back.
I see that it looks like the control goes back to what is in the theme file. So now the question, can i change this at runtime or override the value set in the theme file?
Many thanks!
BTW, your support and product is awesome. I have recommended your products to many coworkers.
0
Mike
Telerik team
answered on 23 Jan 2007, 09:42 AM
Hi Bryan,
Thank you for the nice words.
To your question - yes, you can change the property value of each element you see in the VSB in runtime. You should only assure that this happens after the theme of the control has been changed/loaded, in an event like Form.Load, for example. You can also use selectors (ex. ClassSelector, TypeSelector ) to find the specified element in the control element tree, if that element is not accessible through control's properties.
If you give us more information on which element you wish to customize, we can help you with that too.