Quantcast
Channel: VBForums - Visual Basic .NET
Viewing all articles
Browse latest Browse all 27329

VS 2010 [RESOLVED] 'New' cannot be used on an interface

$
0
0
Ok, so I'm getting an error that says "'New' cannot be used on an interface" with the following code:
Code:

    Private Sub Form1_MouseDown(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseDown
        clicked = True
        mousePoint = New Point(e.X, e.Y)
    End Sub

    Private Sub Form1_MouseMove(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseMove
        If clicked Then
            Me.Location = New Point(Cursor.Position.X - mousePoint.X, Cursor.Position.Y - mousePoint.Y)
        End If
    End Sub

    Private Sub Form1_MouseUp(sender As Object, e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseUp
        clicked = False
    End Sub

The weird part is that I have used this code with other programs and it works fine. I literally copied and pasted it from another program I wrote. Does anyone have any ideas as to why I would get this error ('New' cannot be used on an interface) on one program but not another? Any suggestions, ideas, thoughts, etc. are much appreciated. Thanks!

Viewing all articles
Browse latest Browse all 27329

Trending Articles