Stop vb2008 from checking detailed sub of the the form before running the application
-
Dear All I am using public form to handle the current form in the mdiform like Public frm As windows.forms.form and then assign it to a form using the following lines frm = New Form1 frm.MdiParent = Me frm.Show() and usually calling common sub included in every form but vb2008 shows and error while debugging before run the application checks the included sub in the public form before assigning a form to it and shows "sub name " is not a member of 'System.Windows.Forms.Form could anyone help me to avoid this error or show me an alternative way. Regards Aiman Farouk
-
Dear All I am using public form to handle the current form in the mdiform like Public frm As windows.forms.form and then assign it to a form using the following lines frm = New Form1 frm.MdiParent = Me frm.Show() and usually calling common sub included in every form but vb2008 shows and error while debugging before run the application checks the included sub in the public form before assigning a form to it and shows "sub name " is not a member of 'System.Windows.Forms.Form could anyone help me to avoid this error or show me an alternative way. Regards Aiman Farouk
Aiman Farouk Mohamed wrote:
"sub name " is not a member of 'System.Windows.Forms.Form
The error indicates that the subroutine is not found in the object your trying to call it from. I presume your subroutine is implemented in the Form1 object ?? You can either cast it or change the form variable to Form1 insteast of Windows.Forms.Form
Public frm As Form1
frm.YourSubroutine()Or using your exisiting code, replace the call to the subroutine as
(frm as Form1).YourSubroutine()
-
Dear All I am using public form to handle the current form in the mdiform like Public frm As windows.forms.form and then assign it to a form using the following lines frm = New Form1 frm.MdiParent = Me frm.Show() and usually calling common sub included in every form but vb2008 shows and error while debugging before run the application checks the included sub in the public form before assigning a form to it and shows "sub name " is not a member of 'System.Windows.Forms.Form could anyone help me to avoid this error or show me an alternative way. Regards Aiman Farouk
This doesn't work because you created a normal (nothing on it) instance of a Form class. If you already have a form defined, you should be creating an instace of THAT form, not System.Windows.Form.
A guide to posting questions on CodeProject[^]
Dave Kreskowiak Microsoft MVP Visual Developer - Visual Basic
2006, 2007, 2008