StatusBar Interface

Represents the Status Bar in the Visual Studio integrated development environment (IDE).

Namespace:  EnvDTE
Assembly:  EnvDTE (in EnvDTE.dll)

public interface StatusBar

The StatusBar type exposes the following members.

Public propertyDTEGets the top-level extensibility object.
Public propertyParentGets the immediate parent object of a StatusBar object.
Public propertyTextSets or gets the selected text.

Public methodAnimateDisplays an animated picture in the StatusBar.
Public methodClearClears all text from the StatusBar.
Public methodHighlightToggles highlighting of text within the StatusBar.
Public methodProgressCreates, modifies, and clears the meter control inside the StatusBar .
Public methodSetLineColumnCharacterSets the text column and character indicators in the StatusBar .
Public methodSetXYWidthHeightSets the x, y, width, and height coordinate indicators in the StatusBar.
Public methodShowTextUpdatesDetermines whether the StatusBar shows text updates.

There is only one StatusBar object in the IDE.

Because this example lists all of the tasks currently in the TaskList, make sure it contains some tasks before running the code.

Sub StatusBarExample()
   ' Create object references and initialize variables.
   Dim SBar As StatusBar
   Dim TList As TaskList
   Dim TItems As TaskItems
   Dim TI As TaskItem
   Dim count As Long
   Dim i As Long

   SBar = DTE.StatusBar
   ' Get references to Task List.
   TList = DTE.Windows().Item(Constants.vsWindowKindTaskList).Object
   TItems = TList.TaskItems
   i = 1
   count = TItems.Count
   ' Loop through Task List items, updating progress bar for each item.
   For Each TI In TItems
      SBar.Progress(True, TI.Description, i, count)
      SBar.SetLineColumnCharacter(i, count, 0)
      i = i + 1
      MsgBox("Task: " & i - 1 & vbCr & "Description: " & TI.Description & vbCr & "Next task item...")
   ' All done, so get rid of the bar.
End Sub