I am fairly new to Telerik winforms. I have this issue that I have no idea how to troubleshoot. Can someone help please?
I made two base user controls that one contains a RadLabel and MaskedTextBox, and another contains Raddropdownlist and RadLabel. And then I put these two base user controls to third user control. Now I want to change the textbox background color of MaskedTextBox and RadDropDownList inside the third user control, when the third control is loaded.
Inside the ThirdControl_Load function, I can use the following code to change the background color of RadDropDownList:
radDropdownlist1.radDropDownList.DropDownListElement.EditableElement.BackColor = Color.Red;
However, I can not do the same thing to MaskedTextBox. There is no such an option for me to get to the MaskedTextBox elements. Basically, after I type
maskedTextBox1.
8 Answers, 1 is accepted

Let me change the code a bit so that it is easier to understand.
private void ThirdControl_Load(object sender, EventArgs e){
DropDownListBaseControl.radDropDownList.DropDownListElement.EditableElement.BackColor = Color.Red; (This one Works)
MaskedTextBoxBasecontrol.(not sure which field to choose to change the textbox backcolor)
}

I figured out why the radDropDownList properties can be inherited by the custom user control. It is because a constructor can be set up. Here is the code:
public RadDropDownList radDropDownList
{
get
{
return radDropDownListCustom;
}
set
{
radDropDownListCustom = value;
}
}
But I still can not figure out how to do the same with radMaskedEditBox.

Never mind my previous post, it did not work properly.
Just for someone who doesn't know the basics, you need to go to designer file, and change Private to Public if you need to access all default items from Telerik.
Thank you for writing.
Following the provided information, I have prepared a sample project demonstrating how to customize the BackColor for RadMaskedEditBox. Please refer to the attached zip file and screenshot illustrating the result.
I hope this information helps. Should you have further questions I would be glad to help.
Dess
Telerik

I did exactly the same thing to change the backcolor of dropdownlist. And last night I realized that both my ways of changing accessibility to visual elements are correct. Thank you again for your examples to confirm.

It's kinda embarrassing, but I just realized that there are also textbox properties under dropdownlistelement:
this.radDropDownList.DropDownListElement.TextBox.Fill.BackColor;
this.radDropDownList.DropDownListElement.TextBox.BackColor;

It's kinda embarrassing, but I just realized that there are also textbox properties under dropdownlistelement:
this.radDropDownList.DropDownListElement.TextBox.Fill.BackColor = Color.Aqua <
br
>this.radDropDownList.DropDownListElement.TextBox.BackColor = Color.Aqua
In your code, you used:
this.userControl21.DropDown.DropDownListElement.EditableElement.TextBox.BackColor = Color.Aqua;
this.userControl21.DropDown.DropDownListElement.EditableElement.TextBox.Fill.BackColor = Color.Aqua;
what are the differences between these two? why are there two sets of codes that do exactly the same thing?
FYI: I accidentally press Tab and Enter at the same time and submitted one extra post. I can't delete my previous post. I apologize for any inconvenience that may cause to you.
Thank you for writing back.
Note that when the DropDownStyle property is set to DropDown, the TextBox. That is why you have access to the text box properties. The TextBox property exposes the TextBox. That is why they both do the same job as they are actually one and same element.
I hope this information helps. If you have any additional questions, please let me know.
Regards,
Dess
Telerik