본문 바로가기

Programming/C#-Winform

마우스클릭 -> 좌표메시지창

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

namespace WinFormApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();

this.MouseUp += new MouseEventHandler(OnMouseUp);
}

public void OnMouseUp(object sender, MouseEventArgs arg)
{
this.Text = string.Format("현재 위치: ({0}, {1})", arg.X, arg.Y);
MessageBox.Show(this.Text);

}
}
}

'Programming > C#-Winform' 카테고리의 다른 글

[펌]C# Winform Mysql DataGridView 표시  (0) 2015.09.21
[펌]C# winform 폼 간 데이터 전달  (0) 2015.09.18
윈폼 프레임 작성 관련  (0) 2015.07.23
c# - MySQL SQLyog 연결  (0) 2015.05.19
키보드 입력  (0) 2015.04.28