473,397 Members | 2,068 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.

Accessing a control from on form to another in MDI

I have seen similar requests to this but not quite what i was looking for i
have an mdi interface and i have 3 child forms 2 are application forms
(meaning they do stuff for the application) and the other is a debug window
with a multiline text field for displaying debug messages within the
application.

What happens is i load the debug form on the mdi parents load event and
minimize it then i load my application forms. What i want to know is how to
be able to write messages to the debug window. I had at one point tried to
create the debug window as a global property of the MDI parent but i haven't
been able to reference the frmDebug property that i made within my child
forms. So now i am looking for other suggestions.
Nov 21 '05 #1
2 2093
Gary,

Create a "global" variable on the MDI form to reference the debug form:

Public debugForm As Form2

In the MDI form's Load event, load the debug form:

debugForm = New Form2

debugForm.MdiParent = Me

debugForm.Show()

On any MDI Child application form, write to the debug form:

Dim f As Form1 = Me.MdiParent

f.debugForm.TextBox2.Text = f.debugForm.TextBox2.Text &
ControlChars.NewLine & "Debug info"

Kerry Moorman

"Gary Townsend" wrote:
I have seen similar requests to this but not quite what i was looking for i
have an mdi interface and i have 3 child forms 2 are application forms
(meaning they do stuff for the application) and the other is a debug window
with a multiline text field for displaying debug messages within the
application.

What happens is i load the debug form on the mdi parents load event and
minimize it then i load my application forms. What i want to know is how to
be able to write messages to the debug window. I had at one point tried to
create the debug window as a global property of the MDI parent but i haven't
been able to reference the frmDebug property that i made within my child
forms. So now i am looking for other suggestions.

Nov 21 '05 #2
Thanks Kerry right after i sent it i had a brain wave and figured if i
created a public debug window object on the child form i could load the
debug window on the parent form then pass the parent window's debug window
to the child when it loads, i then created a public sub on the debug form
that takes care of my writing to the text box.: Makes more sense if i show
it:

Public Class frmParent
Inherits System.Windows.Forms.Form
Public frmDebug As New Debug

Private Sub frmParent_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles MyBase.Load
frmDebug.MdiParent = Me
frmDebug.Show()
frmDebug.WindowState = FormWindowState.Minimized
End Sub

Private Sub OpenMap_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MenuOpenMapWindow.Click
Dim MapForm As New frmMain

MapForm.MdiParent = Me
MapForm.Show()
MapForm.DebuggingForm = frmDebug
End Sub

End Class

Public Class frmMain
Inherits System.Windows.Forms.Form
Public DebuggingForm As Debug

End Class
"Kerry Moorman" <Ke**********@discussions.microsoft.com> wrote in message
news:38**********************************@microsof t.com...
Gary,

Create a "global" variable on the MDI form to reference the debug form:

Public debugForm As Form2

In the MDI form's Load event, load the debug form:

debugForm = New Form2

debugForm.MdiParent = Me

debugForm.Show()

On any MDI Child application form, write to the debug form:

Dim f As Form1 = Me.MdiParent

f.debugForm.TextBox2.Text = f.debugForm.TextBox2.Text &
ControlChars.NewLine & "Debug info"

Kerry Moorman

"Gary Townsend" wrote:
I have seen similar requests to this but not quite what i was looking for i have an mdi interface and i have 3 child forms 2 are application forms
(meaning they do stuff for the application) and the other is a debug window with a multiline text field for displaying debug messages within the
application.

What happens is i load the debug form on the mdi parents load event and
minimize it then i load my application forms. What i want to know is how to be able to write messages to the debug window. I had at one point tried to create the debug window as a global property of the MDI parent but i haven't been able to reference the frmDebug property that i made within my child
forms. So now i am looking for other suggestions.

Nov 21 '05 #3

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

Similar topics

3
by: Tom Meuzelaar | last post by:
Hello: I'm using VB6 in VS enterprise. I'd like to place an HTML form inside a VB container, have a user fill out the form information, click a submit button, and then have the program capture...
1
by: JC | last post by:
How do I extract data from a form into the main form for processing? For instance, I have several image files in a form called images(images.frm), indexed from 0 to 99, and I want to import these...
3
by: Vivek Sharma | last post by:
Hi, I have created a dropdownlist as a web user control. I am using its multiple instances on the webpage. How do I access the selectedValue of each instance? All the instances have different...
1
by: tmaster | last post by:
Within a class, can I create a property that is a listview? Here's what I tried, but it doesn't seem to work: '------------ create property to give the second form access to the first form's...
9
by: Blake Weaver | last post by:
Ok, this is probably a no-brainer for most of you but its escaping me and I can't even seem to find the answer in any documentation. How do you access a friend variable of one class, from another...
3
by: Tim Fitzgerald | last post by:
Hello all, I have no problem accessing another form in my app.. however, when I try to access a ListView on a different form, I come up empty... Basically, Dim pForm As New frmMain Dim iCount...
0
by: Geraldine Hobley | last post by:
Hello I have a problem whereby I have a treeview control on one form called projecttree and I wish to clea the nodes from this control in another form The form that contains the treeview is...
0
by: aakash | last post by:
Hello Guys I am upsizing ms access project to give it a ms sql connectivity I am having problem in accessing form control values in ms sql function CREATE FUNCTION "ReportList DateRange"() ...
3
by: =?Utf-8?B?dmJ0cnlpbmc=?= | last post by:
Background: I have a windows form called 'frmMain'. On this form, I have a LABEL control called 'lblWorkStatus', and it's property is set to PUBLIC. On another form, I have a process that checks...
2
by: San24 | last post by:
Guys, Let me explain the application I have - Form > Main Tab Control > Main Tab Page > User Control > Sub Tab Control > Sub Tab Page > User Control > Contols/Text Box. Form - The main...
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
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:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.