메뉴 바로가기

서브메뉴 바로가기

본문 바로가기

logo

묻고 답하기
조회 수 15,803 추천 수 0 댓글 1
?

단축키

Prev이전 문서

Next다음 문서

위로 아래로 댓글로 가기 인쇄 쓰기 목록
?

단축키

Prev이전 문서

Next다음 문서

위로 아래로 댓글로 가기 인쇄 쓰기 목록
?
  • 예제 올려 드립니다.



    제목 없음.png  



    여기에 코드를 입력해주세요public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }
    
            private void button1_Click(object sender, EventArgs e)
            {
                // 화면 클리어
                this.Refresh();
            }
    
            // 마지막 마우스 클릭 위치
            Point m_LastPos = new Point(0, 0);
    
            // brush 생성
            System.Drawing.SolidBrush brushBlue = new System.Drawing.SolidBrush(System.Drawing.Color.Blue);
            
            private void Form1_MouseMove(object sender, MouseEventArgs e)
            {
                if ((e.Button & System.Windows.Forms.MouseButtons.Left) == System.Windows.Forms.MouseButtons.Left)
                {
                    using (System.Drawing.Graphics oGraphics = this.CreateGraphics())
                    {
                        if (m_LastPos != new Point(0, 0))
                        {
                            oGraphics.DrawLine(new Pen(Color.Blue), e.X, e.Y, m_LastPos.X, m_LastPos.Y);
                        }
                        oGraphics.FillEllipse(brushBlue, e.X, e.Y, 1, 1);
                        m_LastPos = e.Location;
                    }
                }
            }
    
            private void Form1_MouseDown(object sender, MouseEventArgs e)
            {
                m_LastPos = e.Location;
            }
    
            private void pictureBox1_Click(object sender, EventArgs e)
            {
                try
                {
                    using (System.Diagnostics.Process p = System.Diagnostics.Process.Start(@"http://whiteat.com/WhiteAT_Csharp"))
                    { }
                }
                catch { }
            }
        }


List of Articles
번호 분류 제목 날짜
39 프로그래밍 궁금한게 있습니다. 1 2013.01.19
38 프로그래밍 c++ 코드좀 봐주세요 1 2013.03.20
37 프로그래밍 asd 2013.04.13
36 프로그래밍 c언어 초보좀 도와주세요 1 2013.04.20
35 프로그래밍 C언어 문제좀 풀어주세요~ 1 2013.05.10
34 프로그래밍 선생님, 테트리스 관련해서 질문이 있습니다..^^; 3 2013.05.19
33 프로그래밍 C언어 문제가 너무 어려워서 질문드려요 1 2013.05.24
32 프로그래밍 더블버퍼링... 1 2013.06.02
31 프로그래밍 c# 테트리스 질문입니다. 1 2013.06.17
30 프로그래밍 c# 시리얼통신 도와주세요. 5 2013.06.18
29 프로그래밍 c# 시리얼통신 어려운 부분알려주세요. 2 2013.06.19
28 프로그래밍 배열 문제인데요 ㅠㅠ 1 2013.06.20
27 프로그래밍 5명의 키를 읽어 들여 가장 큰 키와 작은 키를 구하는 프로그램을 작성하시오 1 2013.06.20
26 프로그래밍 c+초고수님들중 푸실수있는분 ㅠㅠ 1 2013.11.25
» 프로그래밍 C# 폼에다가 마우스로 선그리기 어떻게하나요?? 1 2013.11.29
목록
Board Pagination Prev 1 2 3 4 5 Next
/ 5