Philippe Renaud
asked on
Array of Forms
Hi, I was wondering how to create an Array of Form due to the fact that Index Property is no longer possible in VB 2005
So What I want to do, TheLearnedOne if you remember our last conversation
I need to send a message to (for example) Room 2.
What I dont undestand is, the RoomID is on a SQL databse okay, I get can it no problem in VB. But last time, you were saying it could the solution to get the frm as instance and send message to room(roomNumber)
Thats mean my rooms would be on array right ?
So What I want to do, TheLearnedOne if you remember our last conversation
I need to send a message to (for example) Room 2.
What I dont undestand is, the RoomID is on a SQL databse okay, I get can it no problem in VB. But last time, you were saying it could the solution to get the frm as instance and send message to room(roomNumber)
Thats mean my rooms would be on array right ?
ASKER
https://www.experts-exchange.com/questions/21899336/TCP-Chat-with-Rooms.html
You told me to do that:
Private m_hashRooms As New Hashtable
...
Dim frm As New frmRoom(roomNumber)
m_hashRooms.Add(roomNumber , frm)
Public Sub SendMessageToRoom(ByVal roomNumber As Integer, ByVal message As String)
Dim frm As frmRoom = m_hashRooms(roomNumber)
frm.SendMessage(message)
End Sub
But the frmRoom(roomNumber) means an Array of form right?
So where or or do I create this array. For example, when the user open the Room 1, write Hello on the chat, press send. It should send to all Room 1. my question is Do i have to create an Array of Form for that
You told me to do that:
Private m_hashRooms As New Hashtable
...
Dim frm As New frmRoom(roomNumber)
m_hashRooms.Add(roomNumber
Public Sub SendMessageToRoom(ByVal roomNumber As Integer, ByVal message As String)
Dim frm As frmRoom = m_hashRooms(roomNumber)
frm.SendMessage(message)
End Sub
But the frmRoom(roomNumber) means an Array of form right?
So where or or do I create this array. For example, when the user open the Room 1, write Hello on the chat, press send. It should send to all Room 1. my question is Do i have to create an Array of Form for that
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
I guess you aren't a mind reader, huh? *WINK*
Bob
Bob
ASKER
Well, im confused on what i am doing.
Maybe I go too far though, im trying to create a Multi-Chat users and Rooms. There is no such examples with VB.NET and VB2005 . I didnt find. I found some for Vb6 with winsock but Its quite old now.
Maybe I go too far though, im trying to create a Multi-Chat users and Rooms. There is no such examples with VB.NET and VB2005 . I didnt find. I found some for Vb6 with winsock but Its quite old now.
I don't understand your question. Do you have the link to the previous question still?
Bob