Solved

Array of Forms

Posted on 2006-06-29
5
347 Views
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 ?
0
Comment
Question by:PhilippeRenaud
  • 3
  • 2
5 Comments
 
LVL 96

Expert Comment

by:Bob Learned
ID: 17010735
Philippe,

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

Bob
0
 
LVL 1

Author Comment

by:PhilippeRenaud
ID: 17011342
http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21899336.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
0
 
LVL 96

Accepted Solution

by:
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

Bob
0
 
LVL 96

Expert Comment

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

Bob
0
 
LVL 1

Author Comment

by:PhilippeRenaud
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.
0

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…
In a recent question (https://www.experts-exchange.com/questions/29004105/Run-AutoHotkey-script-directly-from-Notepad.html) here at Experts Exchange, a member asked how to run an AutoHotkey script (.AHK) directly from Notepad++ (aka NPP). This video…

832 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