RoundRectShape

4 posts, 0 answers
  1. Bryan Brannon
    Bryan Brannon avatar
    65 posts
    Member since:
    Aug 2012

    Posted 16 Jan 2007 Link to this post

    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.
  2. Mike
    Admin
    Mike avatar
    640 posts

    Posted 17 Jan 2007 Link to this post

    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.


    Kind regards,
    Mike
    the telerik team
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Bryan Brannon
    Bryan Brannon avatar
    65 posts
    Member since:
    Aug 2012

    Posted 22 Jan 2007 Link to this post

    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.
  5. Mike
    Admin
    Mike avatar
    640 posts

    Posted 23 Jan 2007 Link to this post

    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.


    All the best,
    Mike
    the telerik team
Back to Top