Expandir Minimizar
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

Evento Control.LocationChanged

Ocorre quando o Location valor da propriedade é alterado.

Namespace:  System.Windows.Forms
Assembly:  System.Windows.Forms (em System.Windows.Forms.dll)
public event EventHandler LocationChanged

Este evento é gerado se o Location propriedade é alterada, uma modificação através de programação ou por meio de interação.

Para obter mais informações sobre tratamento eventos, consulte Consumindo Eventos.

O exemplo de código a seguir gera a LocationChanged evento em um StatusStrip Quando o formulário é redimensionado.

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;


publicclass Form1 : Form
{
    private StatusStrip statusStrip1;

    public Form1()
    {
        InitializeComponent();
    }
    [STAThread]
    staticvoid Main()
    {
        Application.EnableVisualStyles();
        Application.SetCompatibleTextRenderingDefault(false);
        Application.Run(new Form1());
    }

    privatevoid InitializeComponent()
    {
        this.statusStrip1 = new System.Windows.Forms.StatusStrip();
        this.SuspendLayout();
        // // statusStrip1// this.statusStrip1.Location = new System.Drawing.Point(0, 251);
        this.statusStrip1.Name = "statusStrip1";
        this.statusStrip1.Size = new System.Drawing.Size(292, 22);
        this.statusStrip1.TabIndex = 0;
        this.statusStrip1.Text = "statusStrip1";
        this.statusStrip1.LocationChanged += new System.EventHandler(this.statusStrip1_LocationChanged);
        // // Form1// this.ClientSize = new System.Drawing.Size(292, 273);
        this.Controls.Add(this.statusStrip1);
        this.Name = "Form1";
        this.ResumeLayout(false);
        this.PerformLayout();

    }

    privatevoid statusStrip1_LocationChanged(object sender, EventArgs e)
    {
        MessageBox.Show("The form has been resized.");
    }
}


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

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
Isso foi útil para você?
(1500 caracteres restantes)

Contribuições da comunidade

ADICIONAR
© 2013 Microsoft. Todos os direitos reservados.