SerialPort.PinChanged Event

Represents the method that will handle the serial pin changed event of a SerialPort object.

Namespace: System.IO.Ports
Assembly: System (in system.dll)

event SerialPinChangedEventHandler^ PinChanged {
	void add (SerialPinChangedEventHandler^ value);
	void remove (SerialPinChangedEventHandler^ value);
/** @event */
public void add_PinChanged (SerialPinChangedEventHandler value)

/** @event */
public void remove_PinChanged (SerialPinChangedEventHandler value)

In JScript, you can handle the events defined by a class, but you cannot define your own.
Not applicable.

Serial pin changed events can be caused by any of the items in the SerialPinChange enumeration. Because the operating system determines whether to raise this event or not, not all parity errors may be reported. As part of the event, the new value of the pin is set.

The PinChanged event is raised when a SerialPort object enters the BreakState, but not when the port exits the BreakState. This behavior does not apply to other values in the SerialPinChange enumeration.

PinChanged, DataReceived, and ErrorReceived events may be called out of order, and there may be a slight delay between when the underlying stream reports the error and when the event handler is executed. Only one event handler can execute at a time.

The PinChanged event is raised on a secondary thread. Because this event is raised on a secondary thread, and not the main thread, attempting to modify some elements in the main thread, such as UI elements, could raise a threading exception. If it is necessary to modify elements in the main Form or Control, post change requests back using Invoke, which will do the work on the proper thread.

For more information about handling events, see Consuming Events.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

.NET Compact Framework

Supported in: 2.0