Rectangle.FromLTRB(Int32, Int32, Int32, Int32) Método
Definição
Importante
Algumas informações dizem respeito a um produto pré-lançado que pode ser substancialmente modificado antes de ser lançado. A Microsoft não faz garantias, de forma expressa ou implícita, em relação à informação aqui apresentada.
Cria uma Rectangle estrutura com as localizações das arestas especificadas.
public:
static System::Drawing::Rectangle FromLTRB(int left, int top, int right, int bottom);
public static System.Drawing.Rectangle FromLTRB(int left, int top, int right, int bottom);
static member FromLTRB : int * int * int * int -> System.Drawing.Rectangle
Public Shared Function FromLTRB (left As Integer, top As Integer, right As Integer, bottom As Integer) As Rectangle
Parâmetros
Devoluções
A novidade Rectangle que este método cria.
Exemplos
O exemplo de código seguinte demonstra como criar um retângulo usando o FromLTRB método. Este exemplo foi concebido para ser usado com um Windows Form. Cole este código num formulário e chame o CreateARectangleFromLTRB método ao tratar o evento do Paint formulário, passando e como PaintEventArgs.
private:
void CreateARectangleFromLTRB( PaintEventArgs^ e )
{
Rectangle myRectangle = Rectangle::FromLTRB( 40, 40, 140, 240 );
e->Graphics->DrawRectangle( SystemPens::ControlText, myRectangle );
}
private void CreateARectangleFromLTRB(PaintEventArgs e)
{
Rectangle myRectangle = Rectangle.FromLTRB(40, 40, 140, 240);
e.Graphics.DrawRectangle(SystemPens.ControlText, myRectangle);
}
Private Sub CreateARectangleFromLTRB(ByVal e As PaintEventArgs)
Dim myRectangle As Rectangle = Rectangle.FromLTRB(40, 40, 140, 240)
e.Graphics.DrawRectangle(SystemPens.ControlText, myRectangle)
End Sub
Observações
Este método cria um Rectangle com os cantos superior esquerdo e inferior direito especificados.