Statusbar not being added

Statusbar not being added

BrentBurgess1980
Collaborator Collaborator
504 Views
1 Reply
Message 1 of 2

Statusbar not being added

BrentBurgess1980
Collaborator
Collaborator

Hi All,

 

Have some code that adds to the statusbar, but nothing seems to display.

 

  public void SetPane()
            {
            Document doc = AcApp.DocumentManager.MdiActiveDocument;
            if (doc != null)
                {
                Pane pane = getPane();
                if (pane == null)
                    {
                    pane = new Pane();
                    doc.GetStatusBar().Panes.Add(pane);
                    }

                pane.Enabled = true;

                pane.Style = PaneStyles.Normal;
                pane.Text = string.Format("Client: TEST");
                pane.ToolTipText = "Displays the current client standards";
                pane.Visible = true;
                }
            }
            

        private Pane getPane()
            {
            Pane p = null;
            Document doc = AcApp.DocumentManager.MdiActiveDocument;
            foreach(Pane pane in doc.GetStatusBar().Panes)
                {
                if(pane.Text.Contains("Client:"))
                    {
                    p = pane;
                    break;
                    }
                }
            return p;
            }

I have a snapshot of the statusbar and it looks like is has added something, but not displaying.

 

Is there something that I have missed? 

 

Cheers,

 

Brent

0 Likes
505 Views
1 Reply
Reply (1)
Message 2 of 2

deepak.a.s.nadig
Alumni
Alumni

Does changing the way the status bar is added as below help solve your issue ?

 

Autodesk.AutoCAD.ApplicationServices.Application.StatusBar.Panes.Add(pane);

 

 

0 Likes