纯粹备忘。高手勿见怪。
///
/// 处理通告图标的右键鼠标事件
///
///
///
private void notifyIcon1_MouseDown(object sender, MouseEventArgs e)
{
if(e.Button==MouseButtons.Left)
return;
ButtonItem objItem=D1.ContextMenus["bNotifyContext"] as ButtonItem;
objItem.Displayed=false;
//MessageBox.Show(e.Y.ToString());
//objItem.PopupLocation=new Point(e.X,e.Y);
Point p=new Point(0,0);
CommonClass.GetCursorPos(ref p);
p.X-=objItem.PopupWidth/2;
objItem.MouseLeave+=new EventHandler(objItem_MouseLeave);
objItem.PopupMenu(p);
}
///
/// 处理通告图标的右键鼠标事件
///
///
///
private void notifyIcon1_MouseDown(object sender, MouseEventArgs e)
{
if(e.Button==MouseButtons.Left)
return;
ButtonItem objItem=D1.ContextMenus["bNotifyContext"] as ButtonItem;
objItem.Displayed=false;
//MessageBox.Show(e.Y.ToString());
//objItem.PopupLocation=new Point(e.X,e.Y);
Point p=new Point(0,0);
CommonClass.GetCursorPos(ref p);
p.X-=objItem.PopupWidth/2;
objItem.MouseLeave+=new EventHandler(objItem_MouseLeave);
objItem.PopupMenu(p);
}