Re: Paint message fire galore
- From: Peter Duniho <NpOeStPeAdM@xxxxxxxxxxxxxxxx>
- Date: Fri, 26 Oct 2007 07:17:46 -0000
In article <1808D09C-342B-4086-9797-50B08ED257E4@xxxxxxxxxxxxx>
Jesper,Denmark <JesperDenmark@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote:
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 )
{
radioButton1.Checked = true;
}
else
{
radioButton2.Checked = true;
}
}
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
--
I'm trying a new usenet client for Mac, Nemo OS X.
You can download it at http://www.malcom-mac.com/nemo
.
- References:
- Re: Paint message fire galore
- From: Peter Duniho
- Re: Paint message fire galore
- From: Jesper, Denmark
- Re: Paint message fire galore
- Prev by Date: Re: Windows service
- Next by Date: Re: Using C# Interfaces and User Controls
- Previous by thread: Re: Paint message fire galore
- Next by thread: Re: Paint message fire galore
- Index(es):