protected override void OnMouseLeave(EventArgs e)
        {
            base.OnMouseLeave(e);

            DefaultStatusBarService defaultStatusBarService = (DefaultStatusBarService)ServiceManager.Services.GetService(typeof(DefaultStatusBarService));

            defaultStatusBarService.SetMessage("¾ÍÐ÷");
        }
示例#2
0
        //该函数的作用是当IWorkbenchWindow被关闭时关闭该窗体那的视图
        void CloseWindowEvent(object sender, EventArgs e)
        {
            IViewContent content = sender as IViewContent;

            if (content != null)
            {
                CloseView(content);
                OnActiveViewContentChanged(this, null);

                if (workbench.ViewContentCollection.Count == 0)
                {
                    tabControl.Visible = false;

                    DefaultStatusBarService defaultStatusBarService = (DefaultStatusBarService)ServiceManager.Services.GetService(typeof(DefaultStatusBarService));

                    defaultStatusBarService.SetCaretPosition(0, 0, 0);
                }
            }
        }
        protected override void OnMouseMove(MouseEventArgs e)
        {
            base.OnMouseMove(e);
            int currentTabIndex = -1;

            for (int i = 0; i < _tabPages.Count; i++)
            {
                Rectangle rect = (Rectangle)_tabRects[i];
                if (rect.Contains(e.X, e.Y))
                {
                    currentTabIndex = i;
                    break;
                }
            }
            DefaultStatusBarService defaultStatusBarService = (DefaultStatusBarService)ServiceManager.Services.GetService(typeof(DefaultStatusBarService));
            string message = "¾ÍÐ÷";

            if (currentTabIndex != -1)
            {
                message = ((MyTabPage)TabPages[currentTabIndex]).ViewContent.ContentName;
            }
            defaultStatusBarService.SetMessage(message);
        }