Controls Disappear in VS.NET Form Design view 
Author Message
 Controls Disappear in VS.NET Form Design view

I'm running into a {*filter*} problem with VB.NET: controls
placed on a Windows Form are disappearing when I switch to
Design view in Visual Studio.NET. The code for the
controls is still in the Form's codebehind, and I can
select a control from the controls droplist above the
Form's Properties Window. But I cannot see the controls,
and most times when I run F5 they do not appear.

There is a Microsoft Knowledge Base article addressing
this
( http://www.*-*-*.com/
.ASP), however, the problem keeps reoccurring, even when I
do not edit any of the "Windows Form Designer generated
code". It occurs sporadically.

Does anyone know a work-around for this? Seems like a real
showstopper, and yet I haven't found anything on it in
newsgroups. Odd.

Perhaps it is a VS.NET bug and not VB.NET, but the
Knowledge Base article, above, said specifically it was a
VB.NET bug.



Tue, 16 Mar 2004 05:44:49 GMT  
 Controls Disappear in VS.NET Form Design view
Are you declaring the controls like "Friend Shared Withevents.....".  If so
take out the 'Shared' and you should be fine.  Ken.


Quote:
> I'm running into a {*filter*} problem with VB.NET: controls
> placed on a Windows Form are disappearing when I switch to
> Design view in Visual Studio.NET. The code for the
> controls is still in the Form's codebehind, and I can
> select a control from the controls droplist above the
> Form's Properties Window. But I cannot see the controls,
> and most times when I run F5 they do not appear.

> There is a Microsoft Knowledge Base article addressing
> this
> ( http://www.*-*-*.com/
> .ASP), however, the problem keeps reoccurring, even when I
> do not edit any of the "Windows Form Designer generated
> code". It occurs sporadically.

> Does anyone know a work-around for this? Seems like a real
> showstopper, and yet I haven't found anything on it in
> newsgroups. Odd.

> Perhaps it is a VS.NET bug and not VB.NET, but the
> Knowledge Base article, above, said specifically it was a
> VB.NET bug.



Tue, 16 Mar 2004 06:13:37 GMT  
 Controls Disappear in VS.NET Form Design view
Thanks for your reply.

Actually, I solved it! I think it's a VS.NET bug. The
problem is that this line in InitializeComponent is
getting deleted by VS.NET:

Me.Controls.AddRange(New System.Windows.Forms.Control()
{<your control names added here, e.g., Me.comboBox1})

There was a similar problem with VS.NET and WebForms in
Beta 1, where all the Protected WithEvents statements
would get dropped in the WebForm's codebehind when
returning from the WebForm design view.

So now I'm keeping a commented copy of the
Me.Controls.AddRange statement so that if the uncommented
one gets deleted, I can quickly recreate it.

Quote:
>-----Original Message-----
>Are you declaring the controls like "Friend Shared

Withevents.....".  If so
Quote:
>take out the 'Shared' and you should be fine.  Ken.



>> I'm running into a {*filter*} problem with VB.NET: controls
>> placed on a Windows Form are disappearing when I switch
to
>> Design view in Visual Studio.NET. The code for the
>> controls is still in the Form's codebehind, and I can
>> select a control from the controls droplist above the
>> Form's Properties Window. But I cannot see the controls,
>> and most times when I run F5 they do not appear.

>> There is a Microsoft Knowledge Base article addressing
>> this

( http://www.*-*-*.com/

- Show quoted text -

Quote:
>> .ASP), however, the problem keeps reoccurring, even
when I
>> do not edit any of the "Windows Form Designer generated
>> code". It occurs sporadically.

>> Does anyone know a work-around for this? Seems like a
real
>> showstopper, and yet I haven't found anything on it in
>> newsgroups. Odd.

>> Perhaps it is a VS.NET bug and not VB.NET, but the
>> Knowledge Base article, above, said specifically it was
a
>> VB.NET bug.

>.



Tue, 16 Mar 2004 06:35:07 GMT  
 
 [ 3 post ] 

 Relevant Pages 

1. custom form control: Cannot view design view of forms that inherit this form

2. Setting Properties - Design View vs Form View

3. Can't open VB.NET form in design view (only get code view)

4. Urgent help - Error while opening Form design view on MS Visual Basic.Net

5. Outlook View Control disappears after viewing item

6. VS.NET start page options disappeared

7. VS.NET, WinForms, Design, & the Red X

8. web service and updating web reference with vb.net design time vs run time

9. VS.NET, WinForms, Design, & the Red X

10. web service and updating web reference with vb.net design time vs run time

11. design form view

12. Any tools in VS.net work like ActiveX Control Test Container in VS 6.0

 

 
Powered by phpBB® Forum Software