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?
Thanks for that and this is what i was looking..
I have another question.. Is there any way to set the property in the style library so every time when a control gets selected, it should show this little rectangle? All our controls use isl files for styles and given then number of controls in the application.. it is almost impossible to set the DisplayStyle for each editor.. Can we do this through isl file? I do see one "Selected" tab in the AppStylist but this is not enabled for all controls. Is there a way to enable this for all control types?
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.
Hello ,
Please let me know if there is anything else that I could for you regarding this issue.
Basically there is no way to have style do this for us (other than text editors)?
Thanks for your help!