M
MikeTI
Hi All
I am using VB Net 2008.
I am trying to build a large application with multiple integrated functional
modules like:
- Operation
- Accounting etc.
I have tried to work on a premise where:
- there would be a small root application which will build the basic
environment for the entire application and display the main menu. Variables
that control basic environment would be passed on from one form to another.
- each function module would be a "Windows Forms Control Library".
- when an option is selected from the menu in the root program, the form
would be loaded from the appropriate Windows Forms Control Library (DLL).
- each form has multiple user controls.
NOW:
I am able to load the form and display the first user control. The first
user control hides on demand and a second user control is displayed on the
form. However I am unable to access the controls on the form either from the
first or second user control. Similarly I am unable to access the controls
on the first user control from the second user control.
Questions:
1. Am I doing the right thing or is there any other better way of doing
this.
2. How can I access the controls on the parent from from user controls
(first and second)
Example of Code:
--------------------
Imports AM ' One functional module
Public Class UserClass01
Dim UserControl01s As New UserControl01
Private Sub frmA002_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
UserControl01s .Height = SplitContainer1.Panel2.Height
UserControl01s .Width = SplitContainer1.Panel2.Width
UserControl01s .Parent = Me.SplitContainer1.Panel2
UserControl01s .Dock = DockStyle.Fill
UserControl01s .Show()
End Sub
I am using VB Net 2008.
I am trying to build a large application with multiple integrated functional
modules like:
- Operation
- Accounting etc.
I have tried to work on a premise where:
- there would be a small root application which will build the basic
environment for the entire application and display the main menu. Variables
that control basic environment would be passed on from one form to another.
- each function module would be a "Windows Forms Control Library".
- when an option is selected from the menu in the root program, the form
would be loaded from the appropriate Windows Forms Control Library (DLL).
- each form has multiple user controls.
NOW:
I am able to load the form and display the first user control. The first
user control hides on demand and a second user control is displayed on the
form. However I am unable to access the controls on the form either from the
first or second user control. Similarly I am unable to access the controls
on the first user control from the second user control.
Questions:
1. Am I doing the right thing or is there any other better way of doing
this.
2. How can I access the controls on the parent from from user controls
(first and second)
Example of Code:
--------------------
Imports AM ' One functional module
Public Class UserClass01
Dim UserControl01s As New UserControl01
Private Sub frmA002_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
UserControl01s .Height = SplitContainer1.Panel2.Height
UserControl01s .Width = SplitContainer1.Panel2.Width
UserControl01s .Parent = Me.SplitContainer1.Panel2
UserControl01s .Dock = DockStyle.Fill
UserControl01s .Show()
End Sub