Normal 0 false false false EN-US X-NONE X-NONE
Hi,
We have a requirement to show visual indicator like a border or some other sort of indicator around a control when control gets focus. Is there a way to achieve this through built in property? It’s hard to handle through Gotfocus and LostFocus events manually for 1000+ forms.
Thanks,
No, there's no property for this that would affect all controls in the application.
Most controls that accept focus display a focus rectangle (a dotted line) to indicate focus, though.
and thats what we don't see this focus rectangle on the controls. Do you know the controls which are having this rectangle to indicate focus?
Hello,
I am just checking about the progress of this issue. Let me know If you need my further assistance on this matter?
Thank you for using Infragistics Components.
Thanks for follow up. I have got some time to play with style. I think we can acheive with visual studio 2005.
is there a way we can acheive this with current 2010 based style?
Also, with visual studio 2005 style it still can't add rectangle around combo box, drodown, calendar dropdown and date time editiors.
I need to show this for all the controls as this is one of section 508 requirement from one of our client.
Any Ideas?
Hello,
What you could do in your case is to handle paint event of the component, on which you need to draw this rectangle and to draw it in this event. You could use code like:
private void Form1_Load(object sender, EventArgs e)
{
foreach (Control c in this.Controls)
if(c is UltraComboEditor || c is UltraCalculatorDropDown || c is UltraDateTimeEditor)
c.Paint += new PaintEventHandler(c_Paint);
}
void c_Paint(object sender, PaintEventArgs e)
if (((Control)sender).ContainsFocus)
e.Graphics.DrawRectangle(new Pen(new SolidBrush(Color.Green), 2), ((Control)sender).ClientRectangle);
Also please see attached sample.
Please let me know if you have any further questions.
Basically there is no way to have style do this for us (other than text editors)?
Thanks for your help!
Hello ,
Please let me know if there is anything else that I could for you regarding this issue.