Home All Groups Group Topic Archive Search About

VB2005: Controls not appearing on form

Author
24 Jul 2006 11:02 AM
TyBreaker
I have a form where when you click on a button a new form appears.
However the controls on the new form appear as blanked out regions on
the form until I click on them and suddenly they appear.  I haven't seen
this before but am a bit of a newbie with VB 2005 so does anybody know
why this is happening?
--
  ______     ___               __
/_  __/_ __/ _ )_______ ___ _/ /_____ ____
  / / / // / _  / __/ -_) _ `/  '_/ -_) __/
/_/  \_, /____/_/  \__/\_,_/_/\_\\__/_/
     /___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.

Author
24 Jul 2006 12:12 PM
Herfried K. Wagner [MVP]
"TyBreaker" <tybreakerNO@SPAMhotmail.com> schrieb:
>I have a form where when you click on a button a new form appears.
> However the controls on the new form appear as blanked out regions on
> the form until I click on them and suddenly they appear.  I haven't seen
> this before but am a bit of a newbie with VB 2005 so does anybody know
> why this is happening?

Which code are you using to show the form?

--
M S   Herfried K. Wagner
M V P  <URL:http://dotnet.mvps.org/>
V B   <URL:http://classicvb.org/petition/>
Author
24 Jul 2006 8:28 PM
TyBreaker
Herfried K. Wagner [MVP] wrote:
> "TyBreaker" <tybreakerNO@SPAMhotmail.com> schrieb:
>> I have a form where when you click on a button a new form appears.
>> However the controls on the new form appear as blanked out regions on
>> the form until I click on them and suddenly they appear.  I haven't
>> seen this before but am a bit of a newbie with VB 2005 so does anybody
>> know why this is happening?
>
> Which code are you using to show the form?

newForm.Show

The form does appear but just not rendered properly.  I've been hunting
through the properties of the form to see if there's anything set that
might be related but I haven't had any luck.

Not sure if it is related but my main form is an appbar and when you
click on one of the buttons on the appbar, the new form appears.  Is the
fact that the main form is an appbar causing this oddity in the child
form?  I did have to use APIs to make the appbar function properly so
perhaps it's affecting the other form?

--
  ______     ___               __
/_  __/_ __/ _ )_______ ___ _/ /_____ ____
  / / / // / _  / __/ -_) _ `/  '_/ -_) __/
/_/  \_, /____/_/  \__/\_,_/_/\_\\__/_/
     /___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.
Author
29 Jul 2006 10:47 AM
TyBreaker
TyBreaker wrote:
> I have a form where when you click on a button a new form appears.
> However the controls on the new form appear as blanked out regions on
> the form until I click on them and suddenly they appear.  I haven't seen
> this before but am a bit of a newbie with VB 2005 so does anybody know
> why this is happening?

Well I finally figured this out although can't say I understand why.  My
main form was set to TopMost whereas the spawned form was not.  For some
reason this caused the controls within the spawned form to appear
transparent on initial rendering.  If you clicked on them or simply
moved the spawned form, they then appeared correctly.  Bug?  Who cares,
it's fixed now.

--
  ______     ___               __
/_  __/_ __/ _ )_______ ___ _/ /_____ ____
  / / / // / _  / __/ -_) _ `/  '_/ -_) __/
/_/  \_, /____/_/  \__/\_,_/_/\_\\__/_/
     /___/

There are 10 types of people in this world; those who understand the
binary numbering system and those who don't.

There's no place like 127.0.0.1.

ASCII a silly question, get a silly ANSI.