|
-
Aug 27th, 2005, 04:17 AM
#1
Thread Starter
Addicted Member
How can I find out in which half of the picturebox the mouse is?
How can I find out in which half of the picturebox the mouse is(upper or lower)?
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Aug 27th, 2005, 04:28 AM
#2
Re: How can I find out in which half of the picturebox the mouse is?
Use this as an example:
VB Code:
Option Explicit
Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If Y > Picture1.Height / 2 Then
Picture1.BackColor = vbBlue
Else
Picture1.BackColor = vbRed
End If
End Sub
-
Aug 27th, 2005, 04:34 AM
#3
Thread Starter
Addicted Member
Re: How can I find out in which half of the picturebox the mouse is?
Thanks, if I change Y to X then I'll have the resuults according to x right(like divided with a vertical line)?
"Quis custodiet ipsos custodes?"
Juvenal
Mete the Hun wanted to live in peace with the Chinese. So he gave the Chinese Emperor his favorite horse, best swords in his armory, and lots of other cool stuff. But then the Chinese Emperor asked for one thing. A useless land through the north. It was a small, useless, unproductive, uninhabited piece of land. But Mete the Hun's answer was certain:
I gave you horses, weapons and much more which belonged to me. But the lands are not mine, it's my nation's and I'm ready to fight, kill and die for just an inch my country
-=Joey Jordison R0CKS!! =-
-
Aug 27th, 2005, 04:38 AM
#4
Re: How can I find out in which half of the picturebox the mouse is?
That was my mistake. I was using X instead of Y, but Yes if you use Width instead of Height, you can get the left or right side.
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
|