Array of Forms

Posted on 2006-06-29
Last Modified: 2012-05-05
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 ?
Question by:PhilippeRenaud
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 2
LVL 96

Expert Comment

by:Bob Learned
ID: 17010735

I don't understand your question.  Do you have the link to the previous question still?


Author Comment

ID: 17011342

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)
      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
LVL 96

Accepted Solution

Bob Learned earned 500 total points
ID: 17011519
Sorry, I was thinking about adding an argument to the form's New constructor, and passing in a room number:

Public Sub New(ByVal roomNumber As Integer)

End Sub

LVL 96

Expert Comment

by:Bob Learned
ID: 17011528
I guess you aren't a mind reader, huh?  *WINK*


Author Comment

ID: 17011575
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.

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…

737 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question