ListBox.UseTabStops Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value indicating whether the ListBox can recognize and expand tab characters when drawing its strings.
public:
property bool UseTabStops { bool get(); void set(bool value); };
public bool UseTabStops { get; set; }
member this.UseTabStops : bool with get, set
Public Property UseTabStops As Boolean
Property Value
true
if the control can expand tab characters; otherwise, false
. The default is true
.
Examples
The following code example demonstrates how to create a ListBox that displays items with tab characters.
private:
void CreateTabStopList()
{
ListBox^ listBox1 = gcnew ListBox;
listBox1->SetBounds( 20, 20, 100, 100 );
for ( int x = 1; x < 20; x++ )
{
listBox1->Items->Add( String::Concat( "Item\t", x ) );
}
listBox1->UseTabStops = true;
this->Controls->Add( listBox1 );
}
private void CreateTabStopList()
{
ListBox listBox1 = new ListBox();
listBox1.SetBounds(20,20,100,100);
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;
this.Controls.Add(listBox1);
}
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
Me.Controls.Add(listBox1)
End Sub
Applies to
GitHub에서 Microsoft와 공동 작업
이 콘텐츠의 원본은 GitHub에서 찾을 수 있으며, 여기서 문제와 끌어오기 요청을 만들고 검토할 수도 있습니다. 자세한 내용은 참여자 가이드를 참조하세요.
.NET