Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

TextBox: Override which method to change border?

25 views
Skip to first unread message

Danyel Meyer - dialog-it GmbH

unread,
Dec 15, 2003, 8:16:40 AM12/15/03
to
Hey all...

I´m trying to find a solution to change the border of a TextBox-control,
e.g. the color etc. or let it completely disappear.
I´ve already tried to inherit a System.Windows.Forms.TextBox and to override
its OnPaint and OnPaintBackground methods, but that takes no effect.
Any suggestions what I might have to override? Which method paints the
border?

--
Danyel Meyer
-------------------------------------------
dialog-it GmbH
Röllinghäuser Strasse 55a
31061 Alfeld/Leine

Tel +49 (0) 5181 900 814
Fax +49 (0) 5181 900 815
E-Mail danyel...@dialog-it.de


Tim Wilson [MVP]

unread,
Dec 15, 2003, 10:24:52 AM12/15/03
to
You can always place the TextBox inside a Panel and then clip the border to
hide it by setting the TextBox size slightly greater than its parent
(Panel). And, if you want, you can then place that Panel inside another
Panel and leave a 1 pixel border and have whatever color you want based on
the BackColor. Did that all make sense?

--
Tim Wilson
.Net Compact Framework MVP

"Danyel Meyer - dialog-it GmbH dialog-it.de>" <info<at> wrote in message
news:uYyBz2ww...@TK2MSFTNGP12.phx.gbl...

Danyel Meyer - dialog-it GmbH

unread,
Dec 15, 2003, 10:30:24 AM12/15/03
to
Thanks Tim,

That would surely be an alternative, but I´m looking for something more
"reusable", so creating my own control would do better in this case.

I still hope that someone has a hint where to look further.

Kind reguards,

--
Danyel Meyer
-------------------------------------------
dialog-it GmbH
Röllinghäuser Strasse 55a
31061 Alfeld/Leine

"Tim Wilson [MVP]" <Tim_Wilson@[DieSpamDie]Rogers.com> schrieb im
Newsbeitrag news:ugEJd9xw...@TK2MSFTNGP12.phx.gbl...

Tim Wilson [MVP]

unread,
Dec 15, 2003, 10:40:36 AM12/15/03
to
You can always create what I stated in the last post as a custom control so
that you can reuse it in other situations. If you're not sure about how to
create a custom control have a look at http://www.opennetcf.org/ and see the
source code for a few custom controls.

--
Tim Wilson
.Net Compact Framework MVP

"Danyel Meyer - dialog-it GmbH dialog-it.de>" <info<at> wrote in message

news:%23Z1GhBy...@TK2MSFTNGP12.phx.gbl...

Chris Tacke, eMVP

unread,
Dec 15, 2003, 10:40:16 AM12/15/03
to
Since the TextBox class is sealed, the only alternative is to write your own
control.

--
Chris Tacke, eMVP
Co-Founder and Advisory Board Member
www.OpenNETCF.org
---
Windows CE Product Manager
Applied Data Systems
www.applieddata.net


"Danyel Meyer - dialog-it GmbH dialog-it.de>" <info<at> wrote in message

news:%23Z1GhBy...@TK2MSFTNGP12.phx.gbl...

0 new messages