How about if you bring up the form in design mode. Go to the form properties
window, click on the lightning bolt to bring up the available events, find
Paint. Double-click on the blank space next to it. This will add an
eventhandler to your code-behind for the painting of the form.
Will it completely override? I don't nkow. Try it and see.
RobinS.
GoldMail.com
> How about if you bring up the form in design mode. Go to the form
> properties window, click on the lightning bolt to bring up the available
[quoted text clipped - 3 lines]
>
> Will it completely override? I don't nkow. Try it and see.
It won't. It will handle the Paint event, not override OnPaint().
But Tom's question isn't really about overriding OnPaint(). Overriding
that method is easy. You just add a new OnPaint() method in your subclass
with the keyword "override". That's not what he's asking about though (in
spite of this inaccurate subject line).
He really wants to override the non-client rendering of the window. As
far as I know, there's no way to do this directly from .NET. I think it's
possible that if he overrides the WndProc() method and handles the
NC_PAINT messages himself it _might_ work. But I don't really know enough
about how .NET and the underlying unmanaged window class interact to know
for sure.
Pete
Tom P. - 16 Mar 2008 06:06 GMT
On Mar 15, 11:32 pm, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
> > How about if you bring up the form in design mode. Go to the form
> > properties window, click on the lightning bolt to bring up the available
[quoted text clipped - 19 lines]
>
> Pete
Thanks again Pete,
I should have known you'd be the one to point me in the right
direction. WM_NCPAINT is the message I was supposed to capture but I
still wasn't able to paint in the Non-client area. After a bit more
poking I discovered that Vista does some special stuff during the non-
client paint and it's best to just leave it alone. I'll have to
subclass some of the other controls in my client area (like the
menubar and toolstrip) to do the skinning I want but the window frame
and NC area are out of my league.
Now on to why Vista doesn't handle string trimming correctly.
Tom P.