Re: Opening desig window for a form in Visual Basic 2005 Express Edition

by research@webalive.net on 11/1/2007 4:29:00 AM On 29 oct, 14:17, "Phill W." <p-.-a-.-w-a-r...@-o-p-e-n-.-a-c-.-u-k>
wrote:
> resea...@webalive.net wrote:
> > The Design feature is no more present in the "view menu" nor in the
> > context sensitive menu.
>
> The IDE doesn't think your class /can/ be "designed".
>
> (a) Make sure the class' inheritance is correct:
>
> Class X
> Inherits System.Windows.Forms.Form
>
> (b) Failing that, the IDE will /only/ let you design the /first/ Class
> declared in any source file so you can't design the Form below:
>
> Class NotAForm
> End Class
>
> Class Form2
> Inherits System.Windows.Forms.Form
> End Class
>
> HTH,
> Phill W.

It looks what you explained is the right track.
But I don't really understand the point (b) .... If allow inheritance
on another class, the design is available. How can I choose on which
class I want to use the design ? May I not use the design on any
Form ?

 

Re: Opening desig window for a form in Visual Basic 2005 Express Edition

by Phill W. on 11/2/2007 1:00:00 PM research@webalive.net wrote:

>> (b) Failing that, the IDE will /only/ let you design the /first/ Class
>> declared in any source file so you can't design the Form below:
>>
>> Class NotAForm
>> End Class
>>
>> Class Form2
>> Inherits System.Windows.Forms.Form
>> End Class

> But I don't really understand the point (b) .... If allow inheritance
> on another class, the design is available. How can I choose on which
> class I want to use the design ? May I not use the design on any
> Form ?

It's not the Inheritance getting in the way, it's just that the Forms
Designer only looks as far through the physical source file as the first
Class statement. If that [first] class, whatever it is, isn't
"designable" then it gives up and tells you that you can't design
anything in that source file; the icon in the Solution Explorer changes
and the context [and other] menu[s] no long show the "View Designer"
option.

Put the non-form Class below the Form one and - "magically" - everything
starts working again.

HTH,
    Phill W.