Hi,
You need a reference to the form. If you only have one
instance of the form running at once you can add a shared property to the
form to get reference. Add the follow code to the mdi parent form. Change
frmMdiParent with your forms name
Add to the forms new procedure
Public Sub New()
MyBase.New()
'This call is required by the Windows Form Designer.
InitializeComponent()
'Add any initialization after the InitializeComponent() call
frm = Me
End Sub
Add to the forms dispose procedure
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
frm = Nothing
MyBase.Dispose(disposing)
End Sub
Add the following code to the form
Private Shared frm As frmMDIParent
Public Shared ReadOnly Property DefInstance() As frmMDIParent
Get
If frm Is Nothing Then frm = New frmMDIParent
Return frm
End Get
End Property
To use
Module test
Public Sub changeStatus()
frmMDIParent.DefInstance.StatusBar1.Text = "Live from module"
End Sub
End Module
Ken
-----------------------
"Paul Remblance" <pa**@remblance.co.uk> wrote in message
news:3o************@individual.net...
I have tried several approaches to update the mdiparent status bar from a
module.
A bit complicated as the path could be:
Parent -> Child1 -> dialog1 -> module.sub (long process)
Parent -> Child2 -> dialog2 -> module.sub (long process)
Parent -> Child3 -> dialog3 -> module.sub (long process)
etc. (being a dialog only one process can run at a time)
Tried:
In the module:
dim frm as new Parent
frm.statusbar.page1.text = "something"
Even tried in the parent:
Public Sub UpdateStatusbar(byval strText as String)
statusbar.page1.text = "something"
End Sub
But sub UpdateStatusbar cannot be seen in Module1
Any ideas or can it not be done?
Thanks, Paul