其实最困难就是以下:this.MouseDown += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseDown);this.Load += new System.EventHandler(this.Form1_Load);this.MouseMove += new System.Windows.Forms.MouseEventHandler(this.Form1_MouseMove);

解决方案 »

  1.   

    以上关于mouse的down和move老是通不过vs.net,请各位帮帮忙.
      

  2.   

    Imports System
    Imports System.Collections
    Imports System.ComponentModel
    Imports System.Windows.Forms
    Imports System.IO '用于文件存取 
    Imports System.Data '用于数据访问 
    Imports System.Drawing '提供画GDI+图形的基本功能 
    Imports System.Drawing.Drawing2D '提供画高级二维,矢量图形功能 
    Imports System.Drawing.Imaging
     '提供画GDI+图形的高级功能 
    Namespace DRAW_SAMPLE
        _
       '/ <summary>
       '/ Form1 的摘要说明。
       '/ </summary>
       Public Class Form1
          Inherits System.Windows.Forms.Form
          '/ <summary>
          '/ 必需的设计器变量。
          '/ </summary>
          Private components As System.ComponentModel.Container = Nothing
          Private startDrawing As Integer = 0 '是否绘画
          Private oldpt As New Point(0, 0) '记录原来鼠标位置
          Private newpt As New Point(0, 0) '记录新的鼠标位置
          Private myBitmap As New Bitmap(500, 500, PixelFormat.Format16bppRgb555) '产生一个image对象
          Private myGraphics As Graphics = Nothing
          Public ok As Integer = 0
          
          
          Public Sub New()
             '
             ' Windows 窗体设计器支持所必需的
             '
             InitializeComponent()
          End Sub 'New
           
          '
          ' TODO: 在 InitializeComponent 调用后添加任何构造函数代码
          '
          
          '/ <summary>
          '/ 清理所有正在使用的资源。
          '/ </summary>
          Protected Overrides Sub Dispose(disposing As Boolean)
             If disposing Then
                If Not (components Is Nothing) Then
                   components.Dispose()
                End If
             End If
             MyBase.Dispose(disposing)
          End Sub 'Dispose
          
          
          '
          'ToDo: Error processing original source shown below
          '
          '
          '-----^--- Pre-processor directives not translated
          '/ <summary>
          '
          'ToDo: Error processing original source shown below
          '
          '
          '--^--- Unexpected pre-processor directive
          '/ 设计器支持所需的方法 - 不要使用代码编辑器修改
          '/ 此方法的内容。
          '/ </summary>
          Private Sub InitializeComponent()
             ' 
             ' Form1
             ' 
             Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
             Me.ClientSize = New System.Drawing.Size(560, 382)
             Me.Name = "Form1"
             Me.Text = "Form1"
          End Sub 'InitializeComponent
          
          
          '
          'ToDo: Error processing original source shown below
          '
          '
          '-----^--- Pre-processor directives not translated
          '
          'ToDo: Error processing original source shown below
          '
          '
          '--^--- Unexpected pre-processor directive
          '/ <summary>
          '/ 应用程序的主入口点。
          '/ </summary>
          Shared<STAThread()>  _
          Sub Main()
             Application.Run(New Form1())
          End Sub 'Main
           
          
          Private Sub Form1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles MyBase.Form1_MouseMove
             
             If startDrawing = 1 Then
                newpt = New Point(e.X, e.Y)
                myGraphics.DrawLine(New Pen(Color.Black, 1), oldpt, newpt) '连线
                Form1.ActiveForm.BackgroundImage = CType(myBitmap, Image) '显示轨迹
                Form1.ActiveForm.Invalidate() '重画
                oldpt = newpt
                ok = 0
             End If 
          End Sub 'Form1_MouseMove
          
          
          
          
          Private Sub Form1_Load(sender As Object, e As System.EventArgs) Handles MyBase.Form1_Load
             myGraphics = Graphics.FromImage(myBitmap) '由myBitmap产生一个Graphics对象 
             myGraphics.Clear(Color.White) '绘制myBitmap底图
          End Sub 'Form1_Load
          
          
          Private Sub Form1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles MyBase.Form1_MouseDown
             If startDrawing = 0 And ok = 0 Then
                oldpt.X = e.X
                oldpt.Y = e.Y
                startDrawing = 1 '第一次点击开始绘画
                ok = 1
             End If
             If startDrawing = 1 And ok = 0 Then
                startDrawing = 2
             End If
             
             If startDrawing = 2 Then
                startDrawing = 0
             End If
          End Sub 'Form1_MouseDown
       End Class 'Form1 
    End Namespace 'DRAW_SAMPLE 
      

  3.   

    你是用
    http://www.aspalliance.com/aldotnet/examples/translate.aspx
    转的吧有些语句不好用
      

  4.   

    你那些可以能过form的方法重新生成一次, 再把事件定义那边与函数挂上勾