> Thanks Peter,
> I have been using the paint event handler since MFC (I guess) to
> reflect my data like this:
> ...._Paint(..)
> {
> textBox1.Text = someString;
> //and
> if ( true == foo )
> {
[quoted text clipped - 5 lines]
> }
> }
> Is this not good style?,
No, it's not a good style. Sorry to say, it was never a good style,
whether you were using MFC, or writing straight to the native Win32
API.
> What's the alternative?
That's very hard to say without knowing what "someString" is and what
"foo" is. However, as a general rule of thumb, your design should be
changed so that when "someString" changes, that's where you set the
text in the TextBox, and when "foo" changes, that's where you change
the state of the RadioButton control.
Pete

Signature
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
Jesper, Denmark - 26 Oct 2007 12:01 GMT
Ok, I can appreciate that. I guess that initial population of data into
controls should be moved to the Load event handler (?).
What do you put in the paint event handler then - GDI+ stuff?
regards Jesper.
> > Thanks Peter,
>
[quoted text clipped - 31 lines]
>
> Pete
> I'm trying a new usenet client for Mac, Nemo OS X.
> You can download it at http://www.malcom-mac.com/nemo
Peter Duniho - 26 Oct 2007 17:47 GMT
> Ok, I can appreciate that. I guess that initial population of data
> into controls should be moved to the Load event handler (?).
> What do you put in the paint event handler then - GDI+ stuff?
Yes. Only commands that are specifically involved with drawing (or
"painting", if you will :) ). Many forms and controls have no need
for a custom Paint handler. You should only create a Paint event
handler or override OnPaint in a Control-derived class if you have
some specific need to provide a custom visual representation of the
Control. Other tasks are much better handled elsewhere.
Pete

Signature
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo