I am very new to development and I have a question about my user controls.
I have a panel2 inside a split container that has several user controls loaded into it. Panel 1 has an exit button and I want to call one of the sub routines that is in one of the user controls loaded into Panel2.
Private Sub btnExit_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnExit.Click
Dim dialogMessage As DialogResult
Dim a As New ucTimeTracker
dialogMessage = MessageBox.Show("Are you sure you want to exit?", "Exit Ready Office Assistant?", _
MessageBoxButtons.YesNoCancel, MessageBoxIcon.Question)
If dialogMessage = Windows.Forms.DialogResult.Yes Then
ucTimeTracker.autoWriteFileOnExit()
Me.Close()
Else
Return
End If
End Sub
This line is giving me trouble "ucTimeTracker.autoWriteFileOnExit()" I am getting (reference to non-shared member requires an object reference).
I'm just not sure what I'm missing.
Basically I want the exit button on frmMain.SplitContainer.Panel1 to call autoWriteFileOnExit() on the user control named ucTimeTracker that is loaded into splitContainer.Panel2