If I subclass RadButtonElement, the subclass no longer has the same style applied as a pure RadButtonElement. Here's the simple code snippet:
| ... |
| panel.Children.Add(new RadButtonElement() { Text = "RadButtonElement" }); |
| panel.Children.Add(new MyRadButtonElement() { Text = "MyRadButtonElement" }); |
| } |
| class MyRadButtonElement : RadButtonElement |
| { |
| } |
Can you tell me how to make my RadButtonElement have the same default style (e.g. background color, mouse rollover) as a regular RadButtonElement?
Thanks,
Michael Hewitt
Precision Software Design, LLC
For reference, here is the full body of my Form.OnLoad function:
| void Form1_Load(object sender, EventArgs e) |
| { |
| // Create element container to fill form |
| RadPanel elementsContainer = new RadPanel(); |
| this.Controls.Add(elementsContainer); |
| elementsContainer.Dock = DockStyle.Fill; |
| elementsContainer.BeginInit(); |
| elementsContainer.EndInit(); |
| // Create scroll viewer for scrollbar support |
| RadScrollViewer scrollViewer = new RadScrollViewer(); |
| elementsContainer.PanelElement.Children.Add(scrollViewer); |
| // Create panel to stack buttons |
| StackLayoutPanel panel = new StackLayoutPanel(); |
| scrollViewer.Viewport = panel; |
| panel.Orientation = Orientation.Vertical; |
| panel.Children.Add(new RadButtonElement() { Text = "RadButtonElement" }); |
| panel.Children.Add(new MyRadButtonElement() { Text = "MyRadButtonElement" }); |
| } |
| class MyRadButtonElement : RadButtonElement |
| { |
| } |