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: 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.
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: 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"
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
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
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.
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.