블로그 이미지
Every unexpected event is a path to learning for you.

카테고리

분류 전체보기 (2731)
Unity3D (814)
Programming (474)
Server (33)
Unreal (4)
Gamebryo (56)
Tip & Tech (228)
협업 (57)
3DS Max (3)
Game (12)
Utility (136)
Etc (96)
Link (32)
Portfolio (19)
Subject (90)
iOS,OSX (51)
Android (14)
Linux (5)
잉여 프로젝트 (2)
게임이야기 (3)
Memories (20)
Interest (38)
Thinking (38)
한글 (30)
PaperCraft (5)
Animation (408)
Wallpaper (2)
재테크 (18)
Exercise (3)
나만의 맛집 (3)
냥이 (10)
육아 (16)
Total
Today
Yesterday
03-29 07:22

'PointToScreen'에 해당되는 글 1건

  1. 2010.07.07 PointToClient 와 PointToScreen

PointToClient는 커서의 위치를 어플리케이션의 위치로 계산해주는 매소드이다.

반대로 PointToScreen매소드는 어플리케이션의 위치를 모니터 스크린의 좌표값으로 계산해준다.


예제) TreeView에서 마우스로 클릭된 노드의 아이템 가져오기


 TreeNode tree = null;

               

        private void treeView1_MouseDown(object sender, MouseEventArgs e)

        {

            if (e.Button == MouseButtons.Right)

            {

                tree = treeView1.GetNodeAt(e.X, e.Y);

                // 좌표가 안나올대 PointToClient를 사용하여 좌표값을 알아올 수 있다

                //tree = treeView1.GetNodeAt(treeView1.PointToClient(Cursor.Position).X, treeView1.PointToClient(Cursor.Position).Y);

            }


        }

출처 : http://devangelma.tistory.com/76

반응형

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

윈폼에서 단축키 개발하기  (0) 2010.07.13
Windows Forms Application  (2) 2010.07.07
단축키 만들기 with C#  (1) 2010.07.07
폼과 폼간의 전송 (부모 자식간의 전송)  (0) 2010.07.07
C# 에서의 Enum  (0) 2010.07.06
Posted by blueasa
, |