将项目从sharpdevelop 4.4迁移到Visual Studio 2010

时间:2017-04-21 22:12:36

标签: vb.net migrate sharpdevelop

我需要将项目从Sharpdevelop 4.4迁移到Visual Studio 2010.当我发生错误时。我有一个例子很简单!我尝试创建项目,主要表单是这样的! Mainform.vb

Public Partial Class MainForm
    Public Sub New()
        ' The Me.InitializeComponent call is required for Windows Forms designer support.
        Me.InitializeComponent()

        '
        ' TODO : Add constructor code after InitializeComponents
        '
    End Sub

    Sub Button1Click(sender As Object, e As EventArgs)

    End Sub
    End Class

和Mainform.Designer.vb

Partial Class MainForm
    Inherits System.Windows.Forms.Form

    ''' <summary>
    ''' Designer variable used to keep track of non-visual components.
    ''' </summary>
    Private components As System.ComponentModel.IContainer

    ''' <summary>
    ''' Disposes resources used by the form.
    ''' </summary>
    ''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If components IsNot Nothing Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    ''' <summary>
    ''' This method is required for Windows Forms designer support.
    ''' Do not change the method contents inside the source code editor. The Forms designer might
    ''' not be able to load this method if it was changed manually.
    ''' </summary>
    Private Sub InitializeComponent()
        Me.button1 = New System.Windows.Forms.Button()
        Me.SuspendLayout
        '
        'button1
        '
        Me.button1.Location = New System.Drawing.Point(88, 88)
        Me.button1.Name = "button1"
        Me.button1.Size = New System.Drawing.Size(75, 23)
        Me.button1.TabIndex = 0
        Me.button1.Text = "button1"
        Me.button1.UseVisualStyleBackColor = true
        AddHandler Me.button1.Click, AddressOf Me.Button1Click
        '
        'MainForm
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6!, 13!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(284, 262)
        Me.Controls.Add(Me.button1)
        Me.Name = "MainForm"
        Me.Text = "pruebadeimportacion"
        Me.ResumeLayout(false)
    End Sub
    Private button1 As System.Windows.Forms.Button
    End Class

当我在Visual Studio中打开项目时,运行正常,但是当我进行修改并保存时,文件看起来像这样

Mainform.vb文件

Public Partial Class MainForm
Public Sub New()
    ' The Me.InitializeComponent call is required for Windows Forms designer support.
    Me.InitializeComponent()

    '
    ' TODO : Add constructor code after InitializeComponents
    '
End Sub

Sub Button1Click(ByVal sender As Object, ByVal e As EventArgs) Handles button1.Click

End Sub
End Class

文件:Mainform.Designer.vb

Partial Class MainForm
    Inherits System.Windows.Forms.Form

    ''' <summary>
    ''' Designer variable used to keep track of non-visual components.
    ''' </summary>
    Private components As System.ComponentModel.IContainer

    ''' <summary>
    ''' Disposes resources used by the form.
    ''' </summary>
    ''' <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
    Protected Overrides Sub Dispose(ByVal disposing As Boolean)
        If disposing Then
            If components IsNot Nothing Then
                components.Dispose()
            End If
        End If
        MyBase.Dispose(disposing)
    End Sub

    ''' <summary>
    ''' This method is required for Windows Forms designer support.
    ''' Do not change the method contents inside the source code editor. The Forms designer might
    ''' not be able to load this method if it was changed manually.
    ''' </summary>
    Private Sub InitializeComponent()
        Me.button1 = New System.Windows.Forms.Button()
        Me.SuspendLayout()
        '
        'button1
        '
        Me.button1.Location = New System.Drawing.Point(88, 88)
        Me.button1.Name = "button1"
        Me.button1.Size = New System.Drawing.Size(75, 23)
        Me.button1.TabIndex = 0
        Me.button1.Text = "button1"
        Me.button1.UseVisualStyleBackColor = True
        '
        'MainForm
        '
        Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 13.0!)
        Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
        Me.ClientSize = New System.Drawing.Size(284, 262)
        Me.Controls.Add(Me.button1)
        Me.Name = "MainForm"
        Me.Text = "pruebadeimportacion"
        Me.ResumeLayout(False)

    End Sub
    Private button1 As System.Windows.Forms.Button
    End Class

在此更改中出现错误,&#34;错误处理程序需要... WithEvents&#34; (BC30506) Visual Studio更改代码,并对所有子进行相同的修改。对于这个例子: Sub Button1Click(发件人为对象,e为EventArgs) 改变: Sub Button1Click(ByVal sender As Object,ByVal e As EventArgs)处理button1.Click 这是项目中的所有潜艇,请帮忙! 这个错误出现在项目的所有事件中,它的一个例子但是在一个程序很长时间里我有很多错误,而且修复都非常困难,这个过程是否存在一些解决方案?请帮忙!感谢

0 个答案:

没有答案
相关问题