I'm making the chat portion of my program and now I'm stuck. I had wanted to load multiple instaces of a form (template) but I can't make the form names unique since it's read-only. My planned end-result is something like yahoo messenger chat windows, it all looks the same.
Can anyone help me? This is the draft of the form I'll use as a template.
Last edited by leinad31; Mar 25th, 2003 at 04:06 PM.
OK, I'll use the Tag for the identifier. BTW, I found this:
VB Code:
Dim myChildForms(1 to 4) As Form1
Set myChildForms(1) = New Form1
Set myChildForms(2) = New Form1
Set myChildForms(3) = New Form1
Set myChildForms(4) = New Form1
And I'm considering it since its in an array so the search is easier. I'll probably use a dynamic array instead. Question is, since they will all have the same name (Form1.Name), how will I unload an instance? Unload myChildForms(X)? No other code needed?
Also, when the form is unloaded, will the reference be still in the array? Will I have to do Set myChildForms(X) = Nothing?
I wouldn't want to hurt anybody's feeling but what you found is very much silly (if not stupid) for number of reasons but the main point would probably be this: why bother declaring multiple variables, arrays (let's forget for the moment that you need object) when all you need is just ONE as I showed you. Just copy that snippet to say button click event so every time you click on it - it will create an instance of Form1. THAT IS ALL YOU NEED and I won't respond to this thread any longer as I just don't know how to explain any better.