-
Dec 12th, 2017, 10:58 AM
#1
Thread Starter
Member
Button still able to be clicked if held outside of it?
So I have a button that if you click on it and hold, and then go off of the button while still holding down...then release outside of the button, it still clicks the button. How can I make that not happen?
here is the code for the button
Dim GMButton As New Button
' WrestlerImage.Text = me.getName()
GMButton.Name = "Btn_" & Me.getName()
GMButton.Size = New Size(148, 100)
GMButton.Location = New Point((GMGroup.Width / 2) - (GMButton.Width / 2), GMGroup.Height - GMButton.Height)
GMButton.BackColor = Color.Transparent
GMButton.ForeColor = Color.Transparent
GMButton.FlatStyle = FlatStyle.Flat
GMButton.FlatAppearance.BorderSize = 0
GMButton.BackgroundImage = My.Resources.Button_Unpressed
GMButton.FlatAppearance.MouseDownBackColor = Color.Transparent
GMButton.FlatAppearance.MouseOverBackColor = Color.Transparent
GMButton.BackgroundImageLayout = ImageLayout.Zoom
AddHandler GMButton.MouseUp, AddressOf GMButton_Click
AddHandler GMButton.MouseDown, AddressOf GMButton_Down
AddHandler GMButton.MouseHover, AddressOf GMButton_Hover
AddHandler GMButton.MouseLeave, AddressOf GMButton_Leave
AddHandler GMButton.MouseUp, AddressOf GMButton_Up
GMGroup.Controls.Add(GMButton)
displayed = True
-
Dec 12th, 2017, 11:22 AM
#2
Re: Button still able to be clicked if held outside of it?
You associated the MouseUp event with your Click handler AND a MouseUp handler. Odds are you made a copy/paste error. I bet the first AddHandler line meant to add a handler for the Click event.
This answer is wrong. You should be using TableAdapter and Dictionaries instead.
-
Dec 12th, 2017, 11:27 AM
#3
Thread Starter
Member
Re: Button still able to be clicked if held outside of it?
Originally Posted by Sitten Spynne
You associated the MouseUp event with your Click handler AND a MouseUp handler. Odds are you made a copy/paste error. I bet the first AddHandler line meant to add a handler for the Click event.
WOW are you kidding me!? THANK YOU! can't believe i missed that!
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|