Archive

Archive for September, 2008

Need to left click on a NotifyIcon?

September 17th, 2008 Comments off

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 problem – touch screens are using touch, not mice to interface with the application hence you cannot right click!

Solution is the code below, it allows you to left click (or touch) the trayicon and still display the ContextMenu. What a PIA it was to find this!

using System.Reflection;

private void notifyIcon1_MouseUp(object sender, MouseEventArgs e)
{

if (e.Button == MouseButtons.Left)
{

MethodInfo mi = typeof(NotifyIcon).GetMethod(“ShowContextMenu”, BindingFlags.Instance | BindingFlags.NonPublic);
mi.Invoke(notifyIcon1,
null);

}
}

Determination

September 16th, 2008 Comments off

Determination

Originally uploaded by Infinerty

I was on a short weekend break at the end of August in Licolnshire, England visiting relatives when I noticed a road race going right past where we were visiting………….