New to VB.NET
I have an application with 2 usercontrols on a Form called Main
Login and PhoneLog
When the app runs the phonelog is not visable and the login is.
I am able to login and hide the login control but the phonelog control will not change to visable.
I think this is a lack of the proper reference somewhere but I'm not sure.
I get an error on the Debug for this line of code inside the Login control.
****The Following code is from the Usercontrol Login:*******
Public Function AuthOK()
Me.Hide()
Dim frmMain As Main
frmMain.PhoneLog1.Visible = True '**** This code breaks
End Function
*****************************************
This is the Error:
An unhandled exception of type 'System.NullReferenceException' occurred in ManagementSystem.exe
Additional information: Object reference not set to an instance of an object.
*****************************************
Please Help
Josh
Here are my Imports and Inherits
Imports System
Imports System.Collections
Imports System.Configuration
Imports System.Data
Imports System.Data.SqlClient
Imports System.Security.Cryptography
Imports System.Text
Imports System.Text.RegularExpressions
Inherits System.Windows.Forms.UserControl

user control problem
brjali
Apopka_Pilot
Dim frmMain as Main
' It's not enough to declare the variable.
' It also needs to be initialized
frmMain = new Main
' now frmMain is safe to use
cftdanny
Public Function AuthOK()
Me.Hide()
Dim frmMain As <b>New Main()</b>
frmMain.PhoneLog1.Visible = True '**** This code breaks
Shane Bell
Doug Winters
Dim frmMain As new Main
^
Remco