• Welcome to Valhalla Legends Archive.
 

Question about MDI Childs

Started by Imperceptus, August 17, 2004, 11:12 AM

Previous topic - Next topic

Imperceptus

I have a few mdi Child windows in my program, I want to send data to a routine within the childs at run time, but can not figure out how to refer to the windows.  can anyone help?
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

Grok

Quote from: Imperceptus on August 17, 2004, 11:12 AM
I have a few mdi Child windows in my program, I want to send data to a routine within the childs at run time, but can not figure out how to refer to the windows.  can anyone help?

Use the name of the child window and the public interface you created for the data transfer.

Imperceptus

So say I

Dim frmNewWindow as new Form1


And I do that a few times, how would I call the procedures on different ones? for say a label that needs to be changed on a paticular one during run time?
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

Soul Taker

Quote from: Imperceptus on August 17, 2004, 12:34 PM
So say I

Dim frmNewWindow as new Form1


And I do that a few times, how would I call the procedures on different ones? for say a label that needs to be changed on a paticular one during run time?

frmNewWindow.Label1.Caption = "Blah"

Imperceptus

#4
As I said , It would run a few times, so there would be more then one Instance of frmNewWindow.  I have already though of storying the hwnd of the new window in an array and setting the tag of the new window to the subscript of the array to where it would correspond.  My problem is I do not know how to call procedures based of an hwnd, Or anything close to that idea.

Yes, Soul Taker, your Suggestion would work great, had I not already created a few windows with that line. and then wanted to use a procedure in the third instance.


fixed - for some reason I wrote area instead of array
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.

Eli_1

You should be able to do something like:


Dim frmMyForms(4) as Form
Dim i as Integer

For i = 0 to 4
   Set frmMyForms(i) = New Form1
   frmMyForms(i).Caption = "Form #" & i
   frmMyForms(i).Show
Next i


Stealth

Yes, you need to store references to them somehow. A Collection is probably best suited, depending on how dynamically you need to be able to create new windows.
- Stealth
Author of StealthBot

Imperceptus

Quote from: Eli_1 on August 17, 2004, 01:37 PM
You should be able to do something like:


Dim frmMyForms(4) as Form
Dim i as Integer

For i = 0 to 4
   Set frmMyForms(i) = New Form1
   frmMyForms(i).Caption = "Form #" & i
   frmMyForms(i).Show
Next i

Problem solved, thanks for the suggestion.
Quote from: Hazard on August 07, 2003, 03:15 PM
Highlight your entire code. Press the delete key. Start over again using Cuphead's CSB tutorial and work your way from their rather than raping code from downloaded sources meant purely for learning purposes. If this does not fix the problem, uninstall Visual Basic and get a new hobby. I suggest Cricket.