[quoted text, click to view] "Jarod80" <jaroddb@msn.com> wrote in message
news:E46B943C-9ED3-4D0F-883D-ACB2E434C27A@microsoft.com...
> How is it possibile to draw a black border around the controls (TextBox,
> Combobox) while they're focused, not in designtime, at runtime?
>
> I have inherited the controls in some customclasses of mine.
>
> The problem I seem to have is that my border get overwritten almost
> always.
This won't work the way you're trying to do it. If you draw 1 pixel wider
than your textbox then it won't be visible because it will be outside the
bounds of the control. If you draw inside the bounds then the drawing of the
control will overwrite it. The second option would look pretty ordinary even
if it was possible.
What I would do is create a seperate control or class that acts as the
border. For the control you could position the control behind the
appropriate control and size it to be 2 pixels wider and taller. If you use
a class you could simply draw to the form using Graphics.DrawRect. The
advantage to either of these methods is that you don't have to modify every
control on your form, this will work with pretty much all controls. You
could trap events of the form to check when focus has changed.
Michael