473,397 Members | 2,084 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,397 software developers and data experts.

MDIParent Statusbar

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
Nov 21 '05 #1
2 2036
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

Nov 21 '05 #2
Many thanks, Paul

"Ken Tucker [MVP]" <vb***@bellsouth.net> wrote in message
news:uB**************@TK2MSFTNGP14.phx.gbl...
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


Nov 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Tonya | last post by:
Hi, Does anyone know how i can add controls to a progress bar. I have searched the internet but could not find any examples. what i want to add is a progress bar and a button. thx
18
by: Andrew Poulos | last post by:
If I manage to call the following bit of javascript in IE and MZ w = window.open("", "s", 'status=no,resizable=no,width=450,height=450'); I get a window that is not resizable and without a...
3
by: TonyM | last post by:
Hi all, I have an application with a few different Windows forms. I am trying to update a statusbar panel's text that is in the main form, from another form. When I set the statusbar and the...
9
by: Christian Blackburn | last post by:
Hi Gang, I've had this happen with a couple of controls now, but my patience has worn thin. Can somebody tell me why I can read/write to most objects on my form from my module, but not when...
4
by: rat | last post by:
i am having 3 panels(0,1 & 2) in a Statusbar. Using MDI form, i can access and set the text for the panels(0 and 2).. But how can i access the panel(1) from MDI Child form. like...
26
by: Paul Mars | last post by:
FormParent load opens FormChildA. FormChildA btn click opens FormChildB. (FormChildA and FormChildB are both children of FormParent) (FormChildA and FormChildB are different forms) Problem:...
1
by: herve | last post by:
Hi, everybody I'm working with wxPython 2.8.1.1. Does anybody know how to change the foreground colors in a wx.StatusBar
3
by: S. Viswanathan | last post by:
Hi everybody! In VB.NET 2005, MenuStrip and Statusstrip controls added. When the mouse over on the Menuitem its corresponding Tooptip text should be displayed in the statusstrip. How to...
0
by: kardiss | last post by:
I am trying to add Meebo's "Pop-out" kinda feature to my application which when a button is pressed in a MdiChild form, it kicks that MdiChild form out of the MdiParent boundary and acts like a SDI...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.