Assigning Form Text in Load

  • Thread starter Thread starter jester
  • Start date Start date
J

jester

When I assign a value to the Text property of a form in
the Load event, the form initially appears "invalidated",
particularly the regions where child controls are supposed
to be sited. But after forcing a paint event (by hiding
then showing the form manually), the form displays
properly. I managed to find out that everything works fine
when I put the Text-assigning code in the constructor
instead, but I'm just curious why the behavior is such.
Thanks :)
 
* "jester said:
When I assign a value to the Text property of a form in
the Load event, the form initially appears "invalidated",
particularly the regions where child controls are supposed
to be sited. But after forcing a paint event (by hiding
then showing the form manually), the form displays
properly. I managed to find out that everything works fine
when I put the Text-assigning code in the constructor
instead, but I'm just curious why the behavior is such.

Which version of .NET do you use? What do you mean by "appears
"invalidated""?
 
I'm using VS.NET 2002. By "invalidated", I mean it's as if
the controls are not painted or re-drawn; you can liken it
to an invalidated form w/c doesn't redraw its client area
until you send a WM_PAINT message. I don't know if that's
the proper term to use but that's the behavior.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top