I have Windows Mobile 6.0 application. I have ImageButton control given by Microsoft.
I want my ImageButton control to have focus border like any standard button. How I can do it?
Thanks in advice!
I have Windows Mobile 6.0 application. I have ImageButton control given by Microsoft.
I want my ImageButton control to have focus border like any standard button. How I can do it?
Thanks in advice!
I want to suggest the answer after some manipulations with code.
The trick is to check whether the control is focused in OnPaint method and draw transparent or black border:
gxOff.DrawRectangle(new Pen((this.Focused) ? Color.Black : Color.Transparent), rc);
and call Invalidate() in OnGotFocus and OnLostFocus events:
protected override void OnGotFocus(EventArgs
{
base.OnGotFocus(e);
this.Invalidate();
}
protected override void OnLostFocus(EventArgs e)
{
base.OnLostFocus(e);
this.Invalidate();
}
Hope it will help somebody :)