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?
somay said: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?
I couldn't provide you with a complete list of all controls that support focus rectangles, no. Typically, a focus rectangle displays on any control that takes focus, but I don't think it's 100% true. A TextBox doesn't, for example, because it displays focus using a blinking caret.
What control(s) are you concerned about displaying focus on?
I agree all windows control does show rectangle in blue but i don't see such rectangle in Infragistics controls. As long as windows controls concern, even you have blinking cursor in a text field, it still does show blue rectangle to indicate that field has focus on it.
I am basically looking for same focused rectangle on all Infragistics editors. Is there something which can be done through style?
Hello ,
Could you please let me know on which exactly Infragistics component you can’t see focus rectangle. Could you please post the isl file which you are using to style your application.
I am waiting for your response.
Please let me know if there is anything else that I could for you regarding this issue.
Thank you for using Infragistics Components.
Basically there is no way to have style do this for us (other than text editors)?
Thanks for your help!
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.
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?
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?