
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/
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.
>.