By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,292 Members | 1,702 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,292 IT Pros & Developers. It's quick & easy.

Coding event handlers

P: n/a
AMP
Sorry for my inexpieriance but all the event handlers I've programmed
were with visual components.
I need to write a handler for the
System.IO.Ports.SerialDataReceivedEventHandler

I have a SerialPort object already, but I'm lost as how to code this
event and wire it and get it to fire when data is received.
Thanks
Mike

Sep 12 '06 #1
Share this Question
Share on Google+
1 Reply


P: n/a
static void Main()
{
SerialPort s = new SerialPort();
s.DataReceived += new SerialDataReceivedEventHandler(s_DataReceived);

}

static void s_DataReceived(object sender, SerialDataReceivedEventArgs
e)
{
throw new Exception("The method or operation is not implemented.");
}

If you are using VS 2005, you should be able to get this for free using the
intellisense.

Sorry for my inexpieriance but all the event handlers I've programmed
were with visual components.
I need to write a handler for the
System.IO.Ports.SerialDataReceivedEventHandler
I have a SerialPort object already, but I'm lost as how to code this
event and wire it and get it to fire when data is received.
Thanks
Mike

Sep 12 '06 #2

This discussion thread is closed

Replies have been disabled for this discussion.