非IT企業に勤める中年サラリーマンのIT日記

非IT企業でしかもITとは全く関係ない部署にいる中年エンジニア。唯一の趣味がプログラミングという”自称”プログラマー。

C#: To save the position when sticky note is moved.

      2015/12/29

This is blog that was translated from Japanese to English.
http://non-it-salaryman.blogspot.jp/2015/11/c_12.html

The one of important functions for sticky note is that it is saved the position when sticky note is moved. And when the sticky note is run, it is necessary to put in the position correctly. So, it is necessary to get the position whenever it is moved.

Usually, a sticky note is moved by a mouse-drag. then, it is decided the position by mouse-up. So, it is necessary to program such that it get(and save) the mouse-up-position.

label.MouseUp += new MouseEventHandler(MouseUpped);

The following is the motion when it is mouse-up.

private void MouseUpped(object sender, MouseEventArgs e){
 if(e.Button!=MouseButtons.Left) return;
 long x = this.Location.X;
 long y = this.Location.Y;

 //write the code in order to save x and y position.
}

スポンサーリンク

 - C#応用編