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

VS 2010 Custom Button Problem

$
0
0
Error Getting:
Unable to convert object of type 'System.EventArgs' to object of type 'System.Windows.Forms.MouseEventArgs'.

Tryied Solutions, Change System.EventArgs to System.Windows.Forms.MouseEventArgs, and it didn't worked

Sourcecode:

Public Class ButtonMedium
Inherits Windows.Forms.Button
Public Sub New()
Me.Size = New System.Drawing.Point(200, 25)
Me.FlatStyle = Windows.Forms.FlatStyle.Flat
Me.FlatAppearance.BorderSize = 0
Me.FlatAppearance.BorderColor = Drawing.Color.FromArgb(68, 68, 68)
Me.FlatAppearance.MouseDownBackColor = Drawing.Color.Transparent
Me.FlatAppearance.MouseOverBackColor = Drawing.Color.Transparent
Me.BackColor = Drawing.Color.Transparent
Me.BackgroundImage = My.Resources.ButtonMedium
Me.BackgroundImageLayout = Windows.Forms.ImageLayout.Stretch
End Sub


Private Sub ButtonMedium_MouseEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseEnter
Me.BackgroundImage = My.Resources.ButtonMedium_push
End Sub

Private Sub ButtonMedium_MouseLeave(ByVal sender As Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Me.MouseLeave
Me.BackgroundImage = My.Resources.ButtonMedium
End Sub
End Class

Viewing all articles
Browse latest Browse all 27156

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>