opening a form from within another form

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello
I'm trying to open a form from within another form
I do this several times, and it works okay, but it won't work for this specific form
There are 4 forms that show in the Solutions list, but only 2 of them show up automatically when typing the code to open them
I'm using the code
dim nFrm as new frm_myfor

but am getting the error "frm_myform is not defined"
I use this exact same code to open other forms from forms..
I am not new to programming, but am very new to VB.net
What is the problem here
Thanks
ambe
 
Hi Amber,

Does your solution have frm_myform.vb in it? Also, does intellisense show
this as a valid type when you are typing it in?

Bernie Yaeger

amber said:
Hello,
I'm trying to open a form from within another form.
I do this several times, and it works okay, but it won't work for this specific form.
There are 4 forms that show in the Solutions list, but only 2 of them show
up automatically when typing the code to open them.
 
Hi Bernie,
Yes, frm_myform is showing up in the Solutions window, but no, intellisense does not display it as a choice when typing the code.
As I said, there are 4 forms that show up in the Solutions window, but only two are options with intellisense while typing the code.
I'm baffled!
Thanks :)
amber
 
amber said:
Hi Bernie,
Yes, frm_myform is showing up in the Solutions window, but no,
intellisense does not display it as a choice when typing the code.
As I said, there are 4 forms that show up in the Solutions window, but
only two are options with intellisense while typing the code.
I'm baffled!
Thanks :)
amber
Check to see that the form Class has the same name as the form name. Also
check same in the #Region code.....just a thought.
 
* "=?Utf-8?B?YW1iZXI=?= said:
I'm trying to open a form from within another form.
I do this several times, and it works okay, but it won't work for this specific form.
There are 4 forms that show in the Solutions list, but only 2 of them show up automatically when typing the code to open them.
I'm using the code:
dim nFrm as new frm_myform

but am getting the error "frm_myform is not defined".
I use this exact same code to open other forms from forms...
I am not new to programming, but am very new to VB.net.

The code should work if the forms are defined and the modifiers of the
forms are set to 'Public', 'Friend', or something similar. Make sure
the form's code starts with something like that:

\\\
Public Class Form1
Inherits System.Windows.Forms.Form
 
Back
Top