473,327 Members | 2,069 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

chat application in windows through custom events C#.NET

hi friends, i am new to .net programming.any one help me to write a chat application with custom events in C#.net windows programming.
i got this through delegates.but, i need to do this in custom events.

i wrote some code as follows.
first i taken a form, placed abutton. under that button i write the code to generate a form(form with containing two text boxes, 2 labels and a button.);
i.e., //button_click
Form2 f2=new Form2( );

i defined a delegate and and args class, publisher class as follows
//delegate in namespace scope
public delegate void DelegateHandler(MyArgs ma);

//a class MyArgs used to hold some arguments values
public class MyArgs : EventArgs
{
public string msg;
}

//a class used to raise an event i.e publisher
public class publisher
{
public event DelegateHandler MyEvent;
public void disp(MyArgs ma)
{
MyEvent(ma);
}
}

in second form i use the code as follows
publisher p; MyArgs ma;
//under Form_load
//i created instances of the above classes
p=new publisher( ); ma=new MyArgs( );
p.MyEvent+=new DelegateHandler(receive); //'receive' is an local method
p.disp(ma);
}
public void receive(MyArgs e)
{
txtRes.Text = e.msg;
}

//under button
ma.msg+=textSend.Text;
p.disp(ma);
textSend.Text = " ";
My Problem is : it is complied successfully but its wont displaying the expected result.
so any one help me what is the problem in displaying the message in more than one form of Form2 type.
awaiting to some one help.
Thanks and regards
Sanjay Reddy.T
Feb 7 '08 #1
0 1103

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: mark | last post by:
What's the logical way to build a .NET based chat program? .NET Remoting? MSMQ? Something else? Thanks in advance. Mark
2
by: oracle3001 | last post by:
Hi All, I want to capture / read the text flowing through a chat window that is part of an external application. I should note that I don't just want to capture the text in the chat window...
3
by: Sushil Srivastava | last post by:
Hi Guys, Would you be able to help me using C# GUI (with user interface component) in my MFC application. I have used managed extension, COM-interops, etc but problem is this C# component has...
4
by: Pete | last post by:
I'd like to add a basic chat application to my web site to get the members talking more, I've decided to limit the number of users to 30. There will be a seperate popup with a frame & three pages...
0
by: George Durzi | last post by:
I'm trying to extend the ExceptionManager Application Block and build a custom publisher that writes my exceptions to the database. That's easy part. The difficulty I am having is in configuring my...
3
by: A | last post by:
Hi all! I am currently working on a project where I need to create a web-based chat application that will be used for auctions. If possible, could I get some advice on how to create chat...
11
by: Jason | last post by:
Hi I have a "problem" i have got a ASP.NET application. in this application i have included logging. in the logging i have logged how many seconds it takes for this application to fully load....
8
by: Bllich | last post by:
Greetings, there is a nice multi-user chat application written by Microsoft in VB which code is on the location: http://download.microsoft.com/download/c/4/8/c488a081-85f2-4a2e-a121-...
3
by: John Dalberg | last post by:
I am looking for an asp.net based chat software. I have looked at some (asp.net and php based) and they consist usually of a javascript piece where the web user (visitor) initiates a chat from a...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.