Este artigo foi traduzido por máquina. Coloque o ponteiro do mouse sobre as frases do artigo para ver o texto original. Mais informações.
Tradução
Original
Este tópico ainda não foi avaliado como - Avalie este tópico

Enumeração ScrollBars

Especifica quais barras de rolar será visíveis em um controle.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (em System.Windows.Forms.dll)
public enum ScrollBars
Nome do membro Descrição
Compatível com o .NET Compact Framework None Nenhuma barra de rolar é exibida.
Compatível com o .NET Compact Framework Horizontal São mostradas somente as barras de rolar horizontal.
Compatível com o .NET Compact Framework Vertical São mostradas somente as barras de rolar vertical.
Compatível com o .NET Compact Framework Both Ambas as barras de rolar horizontal e vertical são mostradas.

Essa enumeração é usada por TextBox.ScrollBars.

Nem todos os controles suportam as barras de rolar. Use essa enumeração para especificar quais barras de rolar estará visíveis em um controle em algumas ou todas as circunstâncias.

O exemplo de código a seguir demonstra como usar o ScrollBars enumeração.To executar o exemplo, cole o código a seguir em um formulário. Chamar o SetFourDifferentScrollBars método no construtor do formulário ou Load método de manipulação de eventos.

// Declare four textboxes.internal System.Windows.Forms.TextBox vertical;
	internal System.Windows.Forms.TextBox horizontal;
	internal System.Windows.Forms.TextBox both;
	internal System.Windows.Forms.TextBox none;

	privatevoid SetFourDifferentScrollBars()
	{
		
		this.vertical = new System.Windows.Forms.TextBox();
		this.horizontal = new System.Windows.Forms.TextBox();
		this.both = new System.Windows.Forms.TextBox();
		this.none = new System.Windows.Forms.TextBox();

		// Create a string for the Text property.
		string startString = "The scroll bar style for my textbox is: ";

		// Set the location of the four textboxes.
		horizontal.Location = new Point(10, 10);
		vertical.Location = new Point(10, 70);
		none.Location = new Point(10, 170);
		both.Location = new Point(10, 110);

		// For horizonal scroll bars, the Multiline property must// be true and the WordWrap property must be false.// Increase the size of the Height property to ensure the // scroll bar is visible.
		horizontal.ScrollBars = ScrollBars.Horizontal;
		horizontal.Multiline = true;
		horizontal.WordWrap = false;
		horizontal.Height = 40;
		horizontal.Text = startString + 
			ScrollBars.Horizontal.ToString();

		// For the vertical scroll bar, Multiline must be true.
		vertical.ScrollBars = ScrollBars.Vertical;
		vertical.Multiline = true;
		vertical.Text = startString + ScrollBars.Vertical.ToString();

		// For both scroll bars, the Multiline property // must be true, and the WordWrap property must be false.// Increase the size of the Height property to ensure the // scroll bar is visible.
		both.ScrollBars = ScrollBars.Both;
		both.Multiline = true;
		both.WordWrap = false;
		both.Height = 40;
		both.AcceptsReturn = true;
		both.Text = startString + ScrollBars.Both.ToString();

		// The none scroll bar does not require specific // property settings.
		none.ScrollBars = ScrollBars.None;
		none.Text = startString + ScrollBars.None.ToString();

		// Add the textboxes to the form.this.Controls.Add(this.vertical);
		this.Controls.Add(this.horizontal);
		this.Controls.Add(this.both);
		this.Controls.Add(this.none);

	}


// Declare four textboxes.
System.Windows.Forms.TextBox vertical;
System.Windows.Forms.TextBox horizontal;
System.Windows.Forms.TextBox both;
System.Windows.Forms.TextBox none;

private void SetFourDifferentScrollBars()
{
    this.vertical = new System.Windows.Forms.TextBox();
    this.horizontal = new System.Windows.Forms.TextBox();
    this.both = new System.Windows.Forms.TextBox();
    this.none = new System.Windows.Forms.TextBox();
    // Create a string for the Text property.
    String startString = "The scroll bar style for my textbox is: ";
    // Set the location of the four textboxes.
    horizontal.set_Location(new Point(10, 10));
    vertical.set_Location(new Point(10, 70));
    none.set_Location(new Point(10, 170));
    both.set_Location(new Point(10, 110));
    // For horizonal scroll bars, the Multiline property must
    // be true and the WordWrap property must be false.
    // Increase the size of the Height property to ensure the 
    // scroll bar is visible.
    horizontal.set_ScrollBars(ScrollBars.Horizontal);
    horizontal.set_Multiline(true);
    horizontal.set_WordWrap(false);
    horizontal.set_Height(40);
    horizontal.set_Text(startString + ScrollBars.Horizontal.ToString());
    // For the vertical scroll bar, Multiline must be true.
    vertical.set_ScrollBars(ScrollBars.Vertical);
    vertical.set_Multiline(true);
    vertical.set_Text(startString + ScrollBars.Vertical.ToString());
    // For both scroll bars, the Multiline property 
    // must be true, and the WordWrap property must be false.
    // Increase the size of the Height property to ensure the 
    // scroll bar is visible.
    both.set_ScrollBars(ScrollBars.Both);
    both.set_Multiline(true);
    both.set_WordWrap(false);
    both.set_Height(40);
    both.set_AcceptsReturn(true);
    both.set_Text(startString + ScrollBars.Both.ToString());
    // The none scroll bar does not require specific 
    // property settings.
    none.set_ScrollBars(ScrollBars.None);
    none.set_Text(startString + ScrollBars.None.ToString());
    // Add the textboxes to the form.
    this.get_Controls().Add(this.vertical);
    this.get_Controls().Add(this.horizontal);
    this.get_Controls().Add(this.both);
    this.get_Controls().Add(this.none);
} //SetFourDifferentScrollBars 


Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98, Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

o.NET Framework e.NET Compact Framework não oferecem suporte a todas as versões de cada plataforma. Para obter uma lista de versões suportadas, consulte Requisitos de sistema do .NET framework.

.NET Framework

Compatível com: 3.5, 3.0, 2.0, 1.1, 1.0

.NET Compact Framework

Compatível com: 3.5, 2.0, 1.0
Isso foi útil para você?
(1500 caracteres restantes)
Conteúdo da Comunidade Adicionar