473,473 Members | 2,169 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Dialogs can't see mdichild window controls

I have a legacy vb.net mdi word processor application which I'm
modifying.

I've created many new dialogs. In vb6, I could reference controls on
the child form with code like this:

Dim text as string
temp = frmMDIParent.ActiveForm.TXTextControl1.text

in vb6, this worked from any button on any dialog in the project. In
vb 2005, it returns nothing. How do I get the dialogs to talk to the
frmMDIChild window controls?

Thanks in advance for any help,
Ian

Apr 1 '07 #1
1 1570
On Apr 1, 9:35 am, "ian807" <ian...@yahoo.comwrote:
I have a legacy vb.net mdi word processor application which I'm
modifying.

I've created many new dialogs. In vb6, I could reference controls on
the child form with code like this:

Dim text as string
temp = frmMDIParent.ActiveForm.TXTextControl1.text

in vb6, this worked from any button on any dialog in the project. In
vb 2005, it returns nothing. How do I get the dialogs to talk to the
frmMDIChild window controls?

Thanks in advance for any help,
Ian
The dialog can access the controls of the form, but you must pass the
instance of the form (or control) to the dialog in the constructor.

'Something like this
Dim myDialog As New Dialog(frmMDIChild)

And the inside the dialog, you would have a property or private
variable to hold the form reference. Then you can access the controls
collection of the form.
Another, perhaps better, way is to add a property to the dialog and
then after the dialog closes, you update the MDIChild form:

'In the MDI child form
Dim myDialog As New Dialog() 'nothing passed to the dialog
myDialog.ShowDialog()

Me.TextBox1.Text = myDialog.SomeStringProperty

myDialog.Dispose() 'Remember to Dispose of your dialog forms when
finished with them.

Hope this gives you some ideas.

Chris

Apr 2 '07 #2

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

Similar topics

0
by: mahesh | last post by:
Hi all, I have a doubt with OOAD and Dialogs. I have a Dialog Class. tkSimple.py It contains a class body as below. Now I am calling the tkSimple.py in another python program and using the...
0
by: Supra | last post by:
i got mdichild working. i'm working on similar to mirc chat. when i joined channel #vb the first mdichild is on. then when i wanted to join another channel #visualbasic. then i got second mdichild...
6
by: Claus Holm | last post by:
I'm trying to enable a menuitem in the parent form from a mdichild. Rather than making the menuitems public, I'd go for a public method in the parent form to do the change, but when I call the...
2
by: Ricky K. Rasmussen | last post by:
Hi NG, We have a rather large ASP.NET application that uses popups to display various dialogs to the user. In our work we've come over a rather annoying "bug": If we open a modal dialog using...
6
by: SkeanDu | last post by:
Ok, here is my problem. I have an aspx page that displays a databound datagrid and in one of the datagrid column headers I have an image that when clicked opens up a modal web dialog (another...
0
by: Supra | last post by:
i got mdichild working. i'm working on similar to mirc chat. when i joined channel #vb the first mdichild is on. then when i wanted to join another channel #visualbasic. then i got second mdichild...
3
by: dwelch91 | last post by:
I'm trying unsuccessfully to do something in Tk that I though would be easy. After Googling this all day, I think I need some help. I am admittedly very novice with Tk (I started with it...
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: Jeff Jarrell | last post by:
I'd like to detect the 'x' systembox close on a MDIChild. The formClosing event, ClosingReason just says 'UserClosing' and doesn't differentiate the 'x' close. I have some code I used in the...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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
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...
1
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...
1
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...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.