Using KeyPreview to handle form shortcut keys

If you need to trap shortcut keys in your application to perform misc tasks, use the following code to set KeyPreview to true and then in the KeyDown event handle the actual clicks:  private void Form_OnLoad(object sender, EventArgs e) {…

Dotnet Charting

I was looking for some suitable dotnet charting components/code and came across the following three articles. http://www.c-sharpcorner.com/UploadFile/pseabury/2DCharting11152005052210AM/2DCharting.aspx http://www.c-sharpcorner.com/UploadFile/steve_hall/drawinglinechart02072007053420AM/drawinglinechart.aspx http://www.c-sharpcorner.com/UploadFile/jodonnell/ChartingInGDIplus11192005063716AM/ChartingInGDIplus.aspx Heres a screenshot of the one i’m using:

Get your local machine/computer name in c#

Four ways to get your local network/machine name: string name = Environment.MachineName; string name = System.Net.Dns.GetHostName(); string name = System.Windows.Forms.SystemInformation.ComputerName; string name = System.Environment.GetEnvironmentVariable(“COMPUTERNAME”);

Need to left click on a NotifyIcon?

I’m working on a client/server application that uses touch screens for user input. The app uses the NotifyIcon class to minimise the app to the tray when not required with a ContextMenuStrip to handle right click operations, herin lies the…