Source code to get to UI Elements

5 posts, 1 answers
  1. Jason
    Jason avatar
    10 posts
    Member since:
    Aug 2011

    Posted 31 Oct 2011 Link to this post

    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
  2. Answer
    Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 03 Nov 2011 Link to this post

    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.

  3. UI for WinForms is Visual Studio 2017 Ready
  4. Jason
    Jason avatar
    10 posts
    Member since:
    Aug 2011

    Posted 17 Nov 2011 Link to this post

    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
  5. Ivan Petrov
    Admin
    Ivan Petrov avatar
    701 posts

    Posted 21 Nov 2011 Link to this post

    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.

  6. Jason
    Jason avatar
    10 posts
    Member since:
    Aug 2011

    Posted 27 Dec 2011 Link to this post

    Thanks. That worked great.
Back to Top
UI for WinForms is Visual Studio 2017 Ready