Apply below attribute to your ExtComboBox
[TemplatePart(Name = "FocusVisualElement", Type = typeof(Rectangle))]
Get a hold on Rectangle.
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
Rect = GetTemplateChild("FocusVisualElement") as Rectangle;
}
public Rectangle Rect { get; private set; }
Make sure you call ApplyTemplate()
public class ExtContentControl : ContentControl
{
public ExtContentControl()
{
this.DefaultStyleKey = typeof(ExtContentControl);
RenderControl();
}
private void RenderControl()
{
ExtComboBox extComboBox = new ExtComboBox();
this.Content = extComboBox;
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
Border bor = GetTemplateChild("content") as Border;
ExtComboBox cmbTest = bor.Child as ExtComboBox;
cmbTest.ApplyTemplate();
Rectangle rect = cmbTest.Rect;
}
}
I hope this helps.