static void OnAppMouseDown(object sender, StatusBarMouseDownEventArgs e) { //获取窗格按钮对象 Pane paneButton = (Pane)sender; string alertMessage; //如果点击的不是鼠标左键,则返回 if (e.Button != System.Windows.Forms.MouseButtons.Left) { return; } //切换窗格按钮的状态 if (paneButton.Style == PaneStyles.PopOut)//如果窗格按钮是弹出的,则切换为凹进 { paneButton.Style = PaneStyles.Normal; alertMessage = "程序窗格按钮被按下"; } else { paneButton.Style = PaneStyles.PopOut; alertMessage = "程序窗格按钮没有被按下"; } //更新状态栏以反映窗格按钮的状态变化 Application.StatusBar.Update(); //显示反映窗格按钮变化的信息 Application.ShowAlertDialog(alertMessage); }
void OnAppMouseDown(object sender, StatusBarMouseDownEventArgs e) { Pane paneButton = (Pane)sender; //Document doc = Application.DocumentManager.MdiActiveDocument; //Database db = doc.Database; int dimScale = System.Convert.ToInt32(Application.GetSystemVariable("DIMSCALE")); String dimStyle = System.Convert.ToString(Application.GetSystemVariable("DIMSTYLE")); //string curScale = db.Dimstyle. string curTextStyleName = " DimScale (1:" + dimScale.ToString() + " ) DimStyle:( " + dimStyle + " ) "; //string alertMessage; if (e.Button != System.Windows.Forms.MouseButtons.Left) { return; } paneButton.Text = curTextStyleName; //if (paneButton.Style == PaneStyles.PopOut) //{ // paneButton.Style = PaneStyles.Normal; // alertMessage = "程序窗格按钮被按下"; //} //else //{ // paneButton.Style = PaneStyles.PopOut; // alertMessage = "程序窗格按钮没有被按下"; //} Application.StatusBar.Update(); //Application.ShowAlertDialog(alertMessage); }
private static void PikTray_MouseDown(object sender, StatusBarMouseDownEventArgs e) { Start(); }
public void StatusBarButton1_MouseDown(object sender, StatusBarMouseDownEventArgs e) { Interaction.MsgBox("你按下了该按钮,你可在此添加你要执行的代码!", MsgBoxStyle.OkOnly, null); }