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

Change color add button

3 Answers 116 Views
TabbedForm
This is a migrated thread and some comments may be shown as answers.
Serg
Top achievements
Rank 1
Veteran
Serg asked on 21 Jul 2020, 08:41 AM

Hello! There was a problem. I wanted to change the color of the "Add" button (the button with the plus icon).
I found this element in the style editor (attach a screenshot).
But I can't find how to find this element and change the color through the code. Please tell me how to do this?

 

3 Answers, 1 is accepted

Sort by
0
Nadya | Tech Support Engineer
Telerik team
answered on 21 Jul 2020, 09:19 AM

Hello, Serg,

Note that the "Add" button that is displayed like a plus icon is indeed represented by text. In order to change its color, you should change the ForeColor property of the NewItem button. You can access it as shown below:

this.radTabbedFormControl1.TabbedFormControlTabsElement.NewItem.ForeColor = Color.Red;

I hope this helps. Should you have other questions I will be glad to help.

Regards,
Nadya
Progress Telerik

0
Serg
Top achievements
Rank 1
Veteran
answered on 23 Jul 2020, 05:44 PM
How do I listen to the event - clicking on NewItem? I found the NewItemClicked event, but the documentation doesn't say anything about the arguments to be specified in the receiving function.
Is there some code example?
0
Nadya | Tech Support Engineer
Telerik team
answered on 27 Jul 2020, 01:55 PM

Hi, Serg,

NewItemClicked event is raised when the new tab button is clicked. It offers the standard EventArgs that represents the base class for classes that contain event data. The sender is LightVisualButtonElement that represents the button with the plus icon.

private void TabbedFormControlTabsElement_NewItemClicked(object sender, EventArgs e)
{
    LightVisualButtonElement newItemButton = sender as LightVisualButtonElement;
    newItemButton.ForeColor = Color.Red;
}

Note, RadTabbedForm offers TabAdding/TabAdded events. TabAdding event is raised when a new tab is about to be added to the control and allows it to be canceled. TabAdded is raised when a new tab has been successfully added to the control. Feel free to use them if they are suitable for your scenario. More information you can find here: https://docs.telerik.com/devtools/winforms/controls/forms-and-dialogs/tabbedform/properties-methods-events

If you are experiencing further difficulties it would be greatly appreciated if you can provide more information about which is the exact goal that you are trying to achieve. Thus, we would be able to think of an accurate solution to your problem.

Let me know if you need further assistance.

Regards,
Nadya
Progress Telerik

Tags
TabbedForm
Asked by
Serg
Top achievements
Rank 1
Veteran
Answers by
Nadya | Tech Support Engineer
Telerik team
Serg
Top achievements
Rank 1
Veteran
Share this question
or