Form.MaximumSize Propriedade

Definição

Obtém o tamanho máximo para o qual o formulário pode ser redimensionado.

public:
 property System::Drawing::Size MaximumSize { System::Drawing::Size get(); void set(System::Drawing::Size value); };
public:
 virtual property System::Drawing::Size MaximumSize { System::Drawing::Size get(); void set(System::Drawing::Size value); };
public System.Drawing.Size MaximumSize { get; set; }
public override System.Drawing.Size MaximumSize { get; set; }
member this.MaximumSize : System.Drawing.Size with get, set
Public Property MaximumSize As Size
Public Overrides Property MaximumSize As Size

Valor de Propriedade

A Size que representa o tamanho máximo para a forma.

Exceções

Os valores da altura ou largura dentro do Size objeto são menores que zero.

Exemplos

O exemplo seguinte demonstra a definição da MaximumSize propriedade.

public:
   Form1()
      : Form()
   {
      
      //This call is required by the Windows Form Designer.
      InitializeComponent();
      
      //Set the maximum size, so if user maximizes form, it 
      //will not cover entire desktop.  
      this->MaximumSize = System::Drawing::Size( 500, 500 );
   }
public Form1() : base()
{        

    //This call is required by the Windows Form Designer.
    InitializeComponent();

    //Set the maximum size, so if user maximizes form, it 
    //will not cover entire desktop.  
    this.MaximumSize = new System.Drawing.Size(500, 500);
}
Public Sub New()
    MyBase.New()

    'This call is required by the Windows Form Designer.
    InitializeComponent()

    'Set the maximum size, so if user maximizes form, it 
    'will not cover entire desktop.  
    Me.MaximumSize = New Size(500, 500)


End Sub

Observações

Esta propriedade permite-lhe limitar o tamanho de um formulário a um tamanho máximo especificado. Pode usar esta funcionalidade ao mostrar várias janelas ao mesmo tempo, para garantir que uma única janela não oculta outras janelas. Se esta propriedade for definida para um objeto Size que seja 0 em altura e 0 em largura, a forma não terá tamanho máximo para além dos limites estabelecidos por Windows.

Aplica-se a

Ver também