473,652 Members | 3,173 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

chat application in windows through custom events C#.NET

1 New Member
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+=textSen d.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 1142

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

Similar topics

2
2097
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
1662
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 once, I want to get the new text as and when it is posted into the chat window
3
9824
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 user interface. how should have get window handle from managed windows? Thanks in advance. Sushil
4
1331
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 page 1 = list of users (updates every 10 seconds) page 2 = content / text (updates every 3 seconds) page 3 = text box to type in. I'll be using meta refresh to update the page(s) to the users on a regular basis (every 3-10 seconds). My...
0
2573
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 web application to use the custom publishers. Things to note. I have a reference to Microsoft.ApplicationBlocks.ExceptionManager in my web application The Microsoft.ApplicationBlocks.ExceptionManager is in my GAC, so there is no dll for it in...
3
2591
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 applications and which part of the .NET framework should I delve into? I would really appreciate the help! Cheers,
11
2355
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. i have placed these timing loggings in the Load and Init events on a typical aspx page. i.e. first line of code in Page_Load is DateTime dtStart = DateTime.Now; and the last lines of code are
8
2277
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- ef5cad681313/vbSockets.exe I started translating it in C# and couldn't finish it.. The program 5 years old :) , but I find it very useful, it's
3
2180
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 web page, an operator client which is usually a desktop app or browser based and the server part which serves as a controller between the operator and visitor, sending and receiving the chat text between them. What I have noticed is that the...
0
8811
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8589
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7302
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6160
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5619
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4145
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
2703
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1914
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1591
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.