I had read the thread you mentioned before I posted my question and didn't exactly understand what you were doing. Probably due to me being new to .NET and your answer being in C#.
Based on the response by Danny Cooper this is the way I handled the problem.
Is there anything wrong with my solution?
I created an MDI form called MainAppForm. Defining def as Shared
Public Class MainAppForm
Inherits System.Windows.Forms.Form
Public Shared def As String = "bbb"
From a menu bar I instantiate a child form.
Private Sub CustomerOrdersBar_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles CustomerOrdersBar.Click
Dim ThisForm As New CustomerOrder()
ThisForm.MdiParent = Me
ThisForm.Show()
Then in the load of the child form I retreive the value of "def".
Private Sub CustomerOrder_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim abc As String
abc = MainAppForm.def
This would be simular to adding properties to the Screen object in Visual Foxpro.
You idea may be a better approach, if so, can you explain it in VB code.
Thanks
>Hi, Robert,
>
>This was part of a topic of a recent thread. Check out message #
929309 and message #
929338 (second was a follow-up). Basically the idea is to take common data elements (strings, datasets, etc.) and make them part of a class that can be referenced by multiple forms.
>
>The question dealt with multiple forms accessing a dataset and I gave an example, but the code would cover strings and other data types as well.
>
>Let me know if that helps,
>Kevin