Evento SimpleShape.SizeChanged
Ocorre quando o Size propriedade de uma forma é alterada.
Namespace: Microsoft.VisualBasic.PowerPacks
Assembly: Microsoft.VisualBasic.PowerPacks.Vs (em Microsoft.VisualBasic.PowerPacks.Vs.dll)
Sintaxe
'Declaração
<BrowsableAttribute(True)> _
Public Event SizeChanged As EventHandler
[BrowsableAttribute(true)]
public event EventHandler SizeChanged
[BrowsableAttribute(true)]
public:
event EventHandler^ SizeChanged {
void add (EventHandler^ value);
void remove (EventHandler^ value);
}
[<BrowsableAttribute(true)>]
member SizeChanged : IEvent<EventHandler,
EventArgs>
JScript não oferece suporte a eventos.
Comentários
Este evento será acionado se a propriedade Size for alterada por uma modificação programática ou pela interação do usuário.
Para obter mais informações sobre como identificar eventos, consulte Manipulando e acionando eventos.
Exemplos
O exemplo a seguir mostra como responder a SizeChanged evento em um manipulador de eventos. Este exemplo requer que você tenha dois RectangleShape controles denominados RectangleShape1 e RectangleShape2 em um formulário.
Private Sub RectangleShape1_SizeChanged() Handles RectangleShape1.SizeChanged
' If the second rectangle intersects with the first, move it.
If RectangleShape1.ClientRectangle.IntersectsWith(
RectangleShape2.ClientRectangle) Then
RectangleShape2.Location = New Point(RectangleShape1.Right,
RectangleShape1.Bottom)
End If
End Sub
private void rectangleShape1_SizeChanged(object sender, System.EventArgs e)
{
// If the second rectangle intersects with the first, move it.
if (rectangleShape1.ClientRectangle.IntersectsWith(rectangleShape2.ClientRectangle))
{
rectangleShape2.Location = new Point(rectangleShape1.Right,
rectangleShape1.Bottom);
}
}
Segurança do .NET Framework
- 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ódigo parcialmente confiável.
Consulte também
Referência
Namespace Microsoft.VisualBasic.PowerPacks
Outros recursos
Introdução aos controles de linha e forma (Visual Studio)
Como desenhar linhas com o controle LineShape (Visual Studio)
Como desenhar formas com os controles OvalShape e RectangleShape (Visual Studio)