How to: 設計程式的狀態列上的設計工具區域
設計工具區域的Visual Studio狀態列會顯示適用於編輯,例如,行號或游標位置的資料行數目的資訊。
到 Visual Studio 的狀態列上的設計工具區域的程式
取得執行個體的IVsStatusbar介面,可透過SVsStatusbar服務。
更新設計工具區域的 [狀態列] 藉由呼叫SetInsMode方法以及SetLineColChar方法的IVsStatusbar執行個體。
範例
這個範例會示範如何以程式設計的狀態列上的設計工具區域。
Private Sub DisplayDesignerRegionInfo(ByVal statusBar As IVsStatusbar, ByVal insert As Boolean, ByVal line As Integer, ByVal column As Integer, ByVal character As Integer)
' Set insert/overstrike mode.
Dim mode As Object = If(insert, 0, 1)
statusBar.SetInsMode(mode)
' Display Ln ## Col ## Ch ## information.
Dim ln As Object = line, col As Object = column, ch As Object = character
statusBar.SetLineColChar(ln, col, ch)
End Sub
void DisplayDesignerRegionInfo(IVsStatusbar statusBar,
bool insert, int line, int column, int character)
{
// Set insert/overstrike mode.
object mode = insert ? 0 : 1;
statusBar.SetInsMode(ref mode);
// Display Ln ## Col ## Ch ## information.
object ln = line, col = column, ch = character;
statusBar.SetLineColChar(ref ln, ref col, ref ch);
}