TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Quoc Duong An
NA
9
0
MouseEventHandler error
Aug 11 2010 5:21 AM
Hi experts
I have an error
Cannot implicitly convert type 'System.Windows.Forms.MouseEventHandler' to 'System.EventHandler'
after I add ButtonMouseLeave event to the button.
Pls help me. I'm a newbie
Thanks
Here the code
private void ShowHand(Panel aPanel, Hand aHand)
{
aPanel.Controls.Clear();
Card aCard;
Button aButton;
for (int i = 0; i < aHand.Count; i++)
{
aCard = aHand[i];
aButton = new Button();
aPanel.Controls.Add(aButton);
aButton.Image = (Image)m_icons[aCard.Suit];
aButton.Text = aCard.FaceValue.ToString();
aButton.TextAlign = ContentAlignment.BottomCenter;
aButton.ImageAlign = ContentAlignment.TopCenter;
aButton.FlatStyle = FlatStyle.Flat;
aButton.Height = 40;
aButton.Top = 45 * i;
aButton.Tag = aCard;
aButton.MouseDown += new System.Windows.Forms.MouseEventHandler(ButtonMouseDown);
aButton.MouseMove += new System.Windows.Forms.MouseEventHandler(ButtonMouseMove);
aButton.MouseLeave += new System.Windows.Forms.MouseEventHandler(ButtonMouseLeave); // error occurs
}
}
private void ButtonMouseDown(object sender, System.Windows.Forms.MouseEventArgs e)
{
m_pickedUp = (Button)sender;
((Button)sender).DoDragDrop(sender, DragDropEffects.Move);
}
private void ButtonMouseMove(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.lbTen.Text = ((Button)sender).Text;
}
private void ButtonMouseLeave(object sender, System.Windows.Forms.MouseEventArgs e)
{
this.lbTen.Text = "";
}
Reply
Answers (
2
)
c# problem with webBrowser.ReadyState
Unable to update database from datagridview