Solved

Array of Forms

Posted on 2006-06-29
5
330 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

This article explains how to create and use a custom WaterMark textbox class.  The custom WaterMark textbox class allows you to set the WaterMark Background Color and WaterMark text at design time.   IMAGE OF WATERMARKS STEPS Create VB …
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…
In this video I am going to show you how to back up and restore Office 365 mailboxes using CodeTwo Backup for Office 365. Learn more about the tool used in this video here: http://www.codetwo.com/backup-for-office-365/ (http://www.codetwo.com/ba…
Learn how to create flexible layouts using relative units in CSS.  New relative units added in CSS3 include vw(viewports width), vh(viewports height), vmin(minimum of viewports height and width), and vmax (maximum of viewports height and width).

920 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

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now