この記事は翻訳者によって翻訳されたものです。 記事の文章にポインターを重ねると、原文のテキストが表示されます。 |
訳文
原文
|
Control.LocationChanged イベント
.NET Framework 4
Location プロパティの値が変更された場合に発生します。
アセンブリ: System.Windows.Forms (System.Windows.Forms.dll 内)
フォームのサイズが変更された場合に StatusStrip で LocationChanged イベントを発生させるコード例を次に示します。
using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; public class Form1 : Form { private StatusStrip statusStrip1; public Form1() { InitializeComponent(); } [STAThread] static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Run(new Form1()); } private void 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(); } private void statusStrip1_LocationChanged(object sender, EventArgs e) { MessageBox.Show("The form has been resized."); } }
Windows 7, Windows Vista SP1 以降, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core はサポート対象外), Windows Server 2008 R2 (SP1 以降で Server Core をサポート), Windows Server 2003 SP2
.NET Framework では、各プラットフォームのすべてのバージョンはサポートしていません。 サポートされているバージョンについては、「.NET Framework システム要件」を参照してください。