[問題] 滑鼠事件
因為要做有關滑鼠的程式 以前沒摸過 想先看簡單的範例 來摸索一下
就從網路上看一段簡易的CODE 但測試很久 一直不能出現成果
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 WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Graphics g;
int Mdx;
int Mdy;
private void Form1_Load(object sender, EventArgs e)
{
}
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
if (e.Button == MouseButtons.Left)
{
g.DrawLine(Pens.Black,Mdx,Mdy,e.X,e.Y);
Mdx = e.X;
Mdy = e.Y;
}
}
}
}
==========================================================
想問一下 這樣打為啥一直效果不能出現.....謝謝有大大可以幫忙一下嗎?
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 163.25.118.131
推
07/08 14:11, , 1F
07/08 14:11, 1F
→
07/08 14:15, , 2F
07/08 14:15, 2F
→
07/08 15:44, , 3F
07/08 15:44, 3F
→
07/08 16:16, , 4F
07/08 16:16, 4F
→
07/08 17:22, , 5F
07/08 17:22, 5F
→
07/09 00:42, , 6F
07/09 00:42, 6F
討論串 (同標題文章)