Question virtual form inheritance

resideozsoy

New member
Joined
Aug 27, 2008
Messages
2
Programming Experience
1-3
Hi
I am trying to inherit a form from an othe form
I works if i try with c# however if i use vb.net I have problem
VB.NET:
Public Class Form1
   
End Class

Public Class Form2
    Inherits Form1

End Class

It sows following error:
Error 4 Base class 'Form1' specified for class 'Form2' cannot be different from the base class 'System.Windows.Forms.Form' of one of its other partial types. C:\Documents and Settings\rozsoy\My Documents\myvs2008_projects\ONSITEV3\winmobile5_6_vb_csharp_SVS_V3_controls_vs2008\winmob5\Form2.vb 2 14 winmob5


Any idea?
 
Hi
I solved that problem if I click show all files on the solution explorer it shows designer.vb file.
I changed Inherits System.Windows.Forms.Form with Inherits Form1 in Form2.Designer.vb file.
The error disappeared but if I open from2 designer it shows a message :
visual inheritance is currently disabled because the base class references a device-specific component or contains P/Invoke
Form1 does not have any thing at the moment.
How can I that problem. If I put any control on form1 I can not see it on form2. It should happen shuldnt it?
Thanks
Reside
 
Back
Top