Método SimpleShape.SetBounds
Define os limites da forma como o local especificado e o dimensionar.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (em Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxe
Public Sub SetBounds ( _
x As Integer, _
y As Integer, _
width As Integer, _
height As Integer _
)
Dim instance As SimpleShape
Dim x As Integer
Dim y As Integer
Dim width As Integer
Dim height As Integer
instance.SetBounds(x, y, width, height)
public void SetBounds(
int x,
int y,
int width,
int height
)
public:
void SetBounds(
int x,
int y,
int width,
int height
)
public function SetBounds(
x : int,
y : int,
width : int,
height : int
)
Parâmetros
- x
Tipo: System.Int32
O novo À esquerda ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/P_System_Windows_Forms_Control_Left.htm da forma.
- y
Tipo: System.Int32
O novo Parte superior ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/P_System_Windows_Forms_Control_Top.htm da forma.
- width
Tipo: System.Int32
O novo Largura ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/P_System_Windows_Forms_Control_Width.htm da forma.
- height
Tipo: System.Int32
O novo Altura ms-help://MS.VSCC.v80/MS.MSDN.v80/MS.NETDEVFX.v20.en/CPref17/html/P_System_Windows_Forms_Control_Height.htm da forma.
Comentários
Você pode usar o SetBounds método para alterar o dimensionar da forma e o local em uma única demonstrativo.
Exemplos
O exemplo a seguir mostra como usar o SetBounds método para alterar o dimensionar e a localização de uma forma. Especificamente, a forma é movida para o canto superior esquerdo do formulário e alterada para um quadrado.Este exemplo requer que você tenha um RectangleShape controle chamado RectangleShape1 em um formulário.
PrivateSub RectangleShape1_Click(ByVal sender As System.Object, _
ByVal e As System.EventArgs) Handles RectangleShape1.Click
' Change the Bounds property.
RectangleShape1.SetBounds(0, 0, 100, 100)
EndSub
privatevoid rectangleShape1_Click(System.Object sender, System.EventArgs e)
{
// Change the Bounds property.
rectangleShape1.SetBounds(0, 0, 100, 100);
}
Permissões
- Confiança total para o chamador imediato. O membro não pode ser usado por código parcialmente confiável. Para obter mais informações, consulte Usando bibliotecas de códigos parcialmente Confiável.
Consulte também
Referência
Namespace Microsoft.VisualBasic.PowerPacks
Outros recursos
Introdução à linha e controles de forma (Visual Studio)
Como: Desenhar linhas com o Controlarar de LineShape (Visual Studio)
Como: Desenhar formas com a OvalShape e controles de RectangleShape (Visual Studio)
How to: Draw Shapes with the OvalShape and RectangleShape Controls