This documentation is archived and is not being maintained.

ListBox.UseTabStops Property

Gets or sets a value indicating whether the ListBox can recognize and expand tab characters when drawing its strings.

[Visual Basic]
Public Property UseTabStops As Boolean
public bool UseTabStops {get; set;}
public: __property bool get_UseTabStops();
public: __property void set_UseTabStops(bool);
public function get UseTabStops() : Boolean;
public function set UseTabStops(Boolean);

Property Value

true if the control can expand tab characters; otherwise, false. The default is true.


[Visual Basic, C#, C++] The following example demonstrates how to create a ListBox that displays items with tab characters.

[Visual Basic] 
Private Sub CreateTabStopList()
    Dim listBox1 As New ListBox()
    listBox1.SetBounds(20, 20, 100, 100)

    Dim x As Integer
    For x = 1 To 19
        listBox1.Items.Add(("Item" + ControlChars.Tab + x.ToString()))
    Next x
    ' Make the ListBox display tabs within each item.
    listBox1.UseTabStops = True
End Sub

private void CreateTabStopList()
    ListBox listBox1 = new ListBox();

    for(int x = 1; x < 20;x++)
        listBox1.Items.Add("Item\t" + x.ToString());
    // Make the ListBox display tabs within each item.
    listBox1.UseTabStops = true;

    void CreateTabStopList() {
        ListBox* listBox1 = new ListBox();
        listBox1->SetBounds(20, 20, 100, 100);

        for (int x = 1; x < 20;x++) {
                String::Concat(S"Item\t", __box(x)));
        // Make the ListBox display tabs within each item.
        listBox1->UseTabStops = true;

[JScript] No example is available for JScript. To view a Visual Basic, C#, or C++ example, click the Language Filter button Language Filter in the upper-left corner of the page.


Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also

ListBox Class | ListBox Members | System.Windows.Forms Namespace