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

Source code to get to UI Elements

4 Answers 62 Views
RibbonBar
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 01 Nov 2011, 12:02 AM
Hi,

I'm rather new to the controls (specifically the ribbon) and I'm trying to achieve the Office 2010 look. I used that theme which turns the main application button into a dark blue folder tab. I would like to print "File" in white on this button.

I have found in the UI Elements for the control that I can set the RadApplicationMenuButtonElement.DisplayStyle to Text, change the Forecolor to white, and change the Text to "File". This appears to work in design, but when I run the application and apply the theme, it goes away.

Furthermore I need to support multiple languages, so I would like to set "File" from a language file.
Does anyone know how to get to the UI elements from source code?

Thanks.
Jason

4 Answers, 1 is accepted

Sort by
0
Accepted
Ivan Petrov
Telerik team
answered on 03 Nov 2011, 02:34 PM
Hello Jason,

Thank you for writing.

You can access the RadRibbonBar's ApplicationButton and set the DisplayStyle and Text through the following code:

RadApplicationMenuButtonElement appButton = this.radRibbonBar1.RibbonBarElement.ApplicationButtonElement;
appButton.DisplayStyle = DisplayStyle.Text;
appButton.Text = "File";

I hope this will help you. If you have further questions, I would be glad to help.
Regards,
Ivan Petrov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Jason
Top achievements
Rank 1
answered on 17 Nov 2011, 09:05 PM
Thanks Ivan. That was exactly what I needed.

Can I access all the other properties in the UI Elements of all the controls the same way? They appear to be in an XML format so I didn't know if I should be querying them using XPath or something else.

Thanks.
Jason
0
Ivan Petrov
Telerik team
answered on 21 Nov 2011, 04:42 PM
Hi Jason,

Thank you for writing back.

We strive to keep all the elements of the controls and all properties exposed in the public API. This helps us to greatly improve the flexibility of the controls and helps users customize the controls with ease. If you want to know how to get a certain element and can't find your way in the API, feel free to write to us and we will help you get that element.

I hope this answers your question. Should you need assistance I would be glad to provide it.

Best wishes,
Ivan Petrov
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

0
Jason
Top achievements
Rank 1
answered on 27 Dec 2011, 03:13 PM
Thanks. That worked great.
Tags
RibbonBar
Asked by
Jason
Top achievements
Rank 1
Answers by
Ivan Petrov
Telerik team
Jason
Top achievements
Rank 1
Share this question
or