views:

156

answers:

2

I'm going to be writing a small app based on the .NET SerialPort class.

Is there a generic dialog available for setting the port settings, ala baud rate, data bits, stop bit, parity bit, flow control, etc? I didn't see one in the MSDN documentation, but I would think that one exists, since that stuff doesn't change.

+1  A: 

True it doesn't change, however there isn't exactly a lot of applications configuring serial port applications nowadays. I can't prove a negative, of course, but seeing as how the .NET platform is lacking a print preview dialog, I'd say you're out of luck finding one for configuring serial ports.

I'd look into win32 dialogs. There might be one available to unmanaged folks somewhere for configuring serial ports that you can invoke. Most likely, even if there is one, it would require more heavy lifting than it is worth.

Will
It's lacking a Print Preview dialog? :(... I know .NET is incomplete, but I didn't think it was that incomplete...
sheepsimulator
I guess I'll have to write my own.
sheepsimulator
@Will: I guess my app is in a minority then, as it uses the .NET serial port AND a .NET print preview dialog. :)
Andy
@andy and what classes are those?
Will
System.Windows.Forms.PrintPreviewDialog and System.IO.Ports.SerialPort
Andy
@Andy jeez missed the PPD several times, thanks for that. But SerialPort isn't a dialog for configuring the serial port...
Will
No probs. Yep, I know SerialPort is not a dialog, just meant that is what I use for serial comms on .NET. Probably didn't explain myself too well there.
Andy
+2  A: 

There is no built-in dialog for this, but it is relatively easy to build your own with a few combo-boxes on a form.

Andy