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

Modifying the BackColor of a Panel

1 Answer 85 Views
Panel
This is a migrated thread and some comments may be shown as answers.
Kirk Martin
Top achievements
Rank 1
Kirk Martin asked on 06 Dec 2009, 03:36 AM
Hi.... I am trying to modify the "FillPrimitive" values for a RadPanel using VB.Net Code.  I will admit that I am new to VB.Net and Telerik products.  I currently have installed the demo for WinForms Q3 2009 installed, and am currently going thu a tutorial posed here on this site that references the FormElement.ClientFillPrimitive for a form.  I read the release notes that said I should use a panel in the form to accomplish the same functionality.  I however have not been able to access the FillPrimitive properties for the Panel from code.  I can do so using the smart tag editor... but not from code.

Any help would be appreciated
Thank you

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 07 Dec 2009, 09:19 AM
Hello Kirk Martin,

Thank you for the question.

The controls are built on a hierarchy of elements. This hierarchy could be iterated with the help of the Children collection of an element. In you case you can access the FillPrimitive using this code snippet:

DirectCast(Me.RadPanel1.PanelElement.Children(0), FillPrimitive).BackColor = Color.Red
DirectCast(Me.RadPanel1.PanelElement.Children(0), FillPrimitive).BackColor2 = Color.Orange
DirectCast(Me.RadPanel1.PanelElement.Children(0), FillPrimitive).BackColor3 = Color.Green
DirectCast(Me.RadPanel1.PanelElement.Children(0), FillPrimitive).BackColor4 = Color.Blue
DirectCast(Me.RadPanel1.PanelElement.Children(0), FillPrimitive).NumberOfColors = 4

The hierarchy of elements could be inspected with the help of the Element Hierarchy Editor tool.

I hope this helps. If you have additional questions, feel free to contact me.

Sincerely yours,
Nikolay
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Panel
Asked by
Kirk Martin
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or