This is a migrated thread and some comments may be shown as answers.

Custom Shape Editor

9 Answers 191 Views
Tools - VSB, Control Spy, Shape Editor
This is a migrated thread and some comments may be shown as answers.
British
Top achievements
Rank 1
British asked on 24 Feb 2016, 11:46 AM

Hi

i use telerik 2015 q3 for winforms

i wanna change the shape of my labels. i have several labels and each of them must have their own shape.

i use the shape property in the in smart tag -> edit ui element -> root element -> shape

and select my predefiened shape and then change the border primitive shape and my label shape change successfully.

but when i use the create new shape instead of select predefined shape nothing happen and when i finish create new one in custom shape editor and click ok, no chnage apeare.

could you please tell me right way

Regard

9 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 25 Feb 2016, 05:35 PM
Hello,

Thank you for writing.

In order to display the borders, you also need to set the BorderVisible property of your label to true. Considering the custom shapes defined in the designer, we have an issue logged in our feedback portal. You can track its progress, subscribe to status changes and add your vote/comment to it on the following link - feedback item

As a workaround solution, I can suggest creating your custom shape in the editor tool and then copy the value of its AsString property.Then create a new custom shape at run-time and set its AsString property to the value you have copied from the editor: 
protected override void OnShown(EventArgs e)
{
    base.OnShown(e);
 
    this.radLabel1.BorderVisible = true;
    CustomShape shape = new CustomShape();
    shape.AsString = "20,20,200,100:20,20,False,0,0,0,0,0:196.0684,40.76923,False,0,0,0,0,0:219.6581,119.7436,False,0,0,0,0,0:45.64103,103.3333,False,0,0,0,0,0:";
    this.radLabel1.LabelElement.LabelBorder.Shape = shape;
}

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
British
Top achievements
Rank 1
answered on 27 Feb 2016, 07:10 AM

Hi

Thank you for the reply

i come over that in design time

here is solution:

1. create new custom shape in the shape property of the root element of control.

2. copy AsString value

3 paste above value in shape property of Border Primitive

shape will be apply to control. i did this with a label and worked fine

Best Regard

 

0
Hristo
Telerik team
answered on 29 Feb 2016, 12:10 PM
Hello,

Thank you for sharing your solution with the community.

I confirm that the approach is valid and you can go ahead with it since it fits your scenario.

Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
peter
Top achievements
Rank 1
answered on 15 Jun 2016, 07:44 AM

hi

i mad a shaped label as what picture attached.

when i set the back color of the label it apply to label and not just colorize the label to its border i defined.

i mean i want colorize my label to its border not total label. the color goes furter the border.

could you please give the solution?

thanks

0
Hristo
Telerik team
answered on 15 Jun 2016, 08:33 AM
Hi Peter,

Thank you for writing.

Please make sure that you are applying the same shape to the FillPrimitive object. You can access it through the LabelFill property of the label element. Please check my code snippet below:
protected override void OnShown(EventArgs e)
{
    base.OnShown(e);
 
    this.radLabel1.BorderVisible = true;
    CustomShape shape = new CustomShape();
    shape.AsString = "20,20,200,100:20,20,False,0,0,0,0,0:196.0684,40.76923,False,0,0,0,0,0:219.6581,119.7436,False,0,0,0,0,0:45.64103,103.3333,False,0,0,0,0,0:";
    this.radLabel1.LabelElement.LabelBorder.Shape = shape;
 
    this.radLabel1.LabelElement.LabelFill.BackColor = Color.Red;
    this.radLabel1.LabelElement.LabelFill.Shape = shape;
}

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
peter
Top achievements
Rank 1
answered on 21 Jun 2016, 12:53 PM

hi

i have a pageview that has three tab. in each tab i  have several shaped label.

i want to use several shaped label in another form, but when i copy them they do not look wyhat i want. is there any way to save or copy the created shaped control?

thanks in advanced

0
Hristo
Telerik team
answered on 21 Jun 2016, 03:01 PM
Hello Peter,

Thank you for writing back.

Could you please make sure that the issue you are experiencing is not related to the following feedback item?If that is the case you would need to set the shape programmatically as I suggested in one of my previous posts.

If you keep experiencing the issue please open up a support ticket and send us your project so that we can investigate it locally.

I hope this helps. Should you have further questions please do not hesitate to write back.

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
peter
Top achievements
Rank 1
answered on 22 Jun 2016, 06:53 AM

hi

i have no problem with create shape control from the designer.

i create my shape from border primitive in custom shape editor and give it a unique name. and i also give the created shape to fill primitive shape property to fit color to the correct border.

i have 16 shaped label in each page of my page view and they work fine.

i just want copy for example one of my shaped control and use it in another form.

but when i copy and paste the cpied control is not what i want.i have to again copy the AsString property of my created shaped control and the create my label in the target form and paste fill primitive and border primitive As string shape proprty to work fine.

 

i just want when i copy a shaped control from a form and paste it to another form it's shape keep and do not change.

 

by the way i will send here a tutorial file that show how create shape control to use by other(if have time).

Thanks

0
Hristo
Telerik team
answered on 22 Jun 2016, 03:42 PM
Hi Peter,

Thank you for writing back.

The custom shapes are serialized as separate components and they are not copied when you move the label from one form to another. As you noted, you would need to set the AsString property individually for each of the copied labels. Alternatively, you can also do this at run-time.

I hope this helps. Should you have further questions please do not hesitate to write back. 

Regards,
Hristo Merdjanov
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
Tags
Tools - VSB, Control Spy, Shape Editor
Asked by
British
Top achievements
Rank 1
Answers by
Hristo
Telerik team
British
Top achievements
Rank 1
peter
Top achievements
Rank 1
Share this question
or