Hi newbie here. Just started working with VS 2005 VB and have a question. How do I define the controls from another class? Here is my code (highlighted) -
Imports System.Windows.Forms
Namespace Bryanlgh.Echo.Views
Namespace Bryanlgh.Core.Tasks
Public Class Report
Inherits System.Windows.Forms.UserControl
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cboPcpMd.Text = "" Then
MessageBox.Show("Please enter a Primary Care Physician!")
End If
If cboPhysicianPerforming.Text = "" Then
MessageBox.Show("Please enter an Attending Physician!")
End If
End Sub
End Class
The controls cboPcpMd & cboPhysicianPerforming are from the class PatientInfoJovyEcho with a Namespace of Bryanlgh.Echo.Views. So in this other class Report, I added the Namespace Bryanlgh.Echo.Views but when I compile I get 3 messages -
1. 'Namespace' statement must end with a matching 'End Namespace'.
2. Name 'cboPcpMd is not declared.
3. Name 'cboPhysicianPerforming' is not declared
I also tried using Imports Bryanlgh.Echo.Views instead of Namespace and it also came up with 3 error messages -
1. Namespace or type specified in the Imports ' Bryanlgh.Echo.Views' doesn’t contain a public member or cannot be found.
2. Name 'cboPcpMd is not declared.
3. Name 'cboPhysicianPerforming' is not declared
How should I define these controls? Any help will be greatly appreciated.
Thanks.
Victor
Imports System.Windows.Forms
Namespace Bryanlgh.Echo.Views
Namespace Bryanlgh.Core.Tasks
Public Class Report
Inherits System.Windows.Forms.UserControl
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
If cboPcpMd.Text = "" Then
MessageBox.Show("Please enter a Primary Care Physician!")
End If
If cboPhysicianPerforming.Text = "" Then
MessageBox.Show("Please enter an Attending Physician!")
End If
End Sub
End Class
The controls cboPcpMd & cboPhysicianPerforming are from the class PatientInfoJovyEcho with a Namespace of Bryanlgh.Echo.Views. So in this other class Report, I added the Namespace Bryanlgh.Echo.Views but when I compile I get 3 messages -
1. 'Namespace' statement must end with a matching 'End Namespace'.
2. Name 'cboPcpMd is not declared.
3. Name 'cboPhysicianPerforming' is not declared
I also tried using Imports Bryanlgh.Echo.Views instead of Namespace and it also came up with 3 error messages -
1. Namespace or type specified in the Imports ' Bryanlgh.Echo.Views' doesn’t contain a public member or cannot be found.
2. Name 'cboPcpMd is not declared.
3. Name 'cboPhysicianPerforming' is not declared
How should I define these controls? Any help will be greatly appreciated.
Thanks.
Victor