|
-
Apr 2nd, 2010, 10:17 AM
#1
Thread Starter
PowerPoster
[RESOLVED] Move PictureBoxes to mouse position, anyone???
I am writing some source code, that I am required to have two graphic pictureboxes at two different mouse positons. And they are: X and Y.
Here is my source code, which only has the problem in it:
Code:
Public Sub BackGround1_MouseMove(Index As Integer, Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Y < 0) Or (Y > ScaleHeight) Then
If (X < 0) Or (X > ScaleWidth) Then
If GetCapture() Then ReleaseCapture
Else
If Not GetCapture() Then SetCapture Me.hwnd
Form11.TopCursor1.Move Y
Form11.LeftCursor1.Move X
End If
End If
End Sub
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Apr 2nd, 2010, 10:23 AM
#2
Re: Move PictureBoxes to mouse position, anyone???
 Originally Posted by ThEiMp
I am writing some source code, that I am required to have two graphic pictureboxes at two different mouse positons. And they are: X and Y.
Not sure what you mean by that. Also, one position is determined by X *and* Y coordinates. So to have two you'd have to have (x1, y1) and (x2, y2).
-
Apr 2nd, 2010, 10:45 AM
#3
Thread Starter
PowerPoster
Re: Move PictureBoxes to mouse position, anyone???
Well I am moving a ruler marker into place. One is X and the other one is Y.
Can you please show me the code, to do so???
Really need this. Have been looking on the Internet and this Forum for help, and have come up against nothing much. But that source code, from one of the old threads, on this Forum.
This code seems to be working, but it must be optimised to run at lower cpu usage rates.
Code:
Public Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
If (Y < 0) Or (X < 0) Or (Y > ScaleHeight) Or (X > ScaleWidth) Then
If GetCapture() Then ReleaseCapture
Else
If Not GetCapture() Then SetCapture Me.hwnd
Form11.TopCursor1.Move X
Form11.LeftCursor1.Move Y
End If
End Sub
Last edited by ThEiMp; Apr 2nd, 2010 at 10:59 AM.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
-
Apr 2nd, 2010, 11:04 AM
#4
Re: Move PictureBoxes to mouse position, anyone???
Put two lines on the form (lnLeft and lnTop) and use this code. Try to understand the code, this is extremely simple.
Code:
Option Explicit
Private Sub Form_Load()
lnLeft.X1 = 0
lnLeft.X2 = 120
lnLeft.Y1 = 0
lnLeft.Y2 = 0
lnTop.Y1 = 0
lnTop.Y2 = 120
lnTop.X1 = 0
lnTop.X2 = 0
End Sub
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
lnLeft.Y1 = Y
lnLeft.Y2 = Y
lnTop.X1 = X
lnTop.X2 = X
End Sub
-
Apr 2nd, 2010, 11:09 AM
#5
Thread Starter
PowerPoster
Re: Move PictureBoxes to mouse position, anyone???
The code that you had placed on this thread, worked just fine!!
Thanks for the help!!
Last edited by ThEiMp; Apr 2nd, 2010 at 11:17 AM.
I have a huge free products range, of computer software in which you can download using any kind of 64-Bit Web Browser. Also there is coming a Social Networking section that I am making on my Website...
|Ambra Productions Inc. | The Black Sun Society | The Black Shield | Ambra College | Church of the Black Sun | Ambra Productions Inc's Homepage | Boomtick Venues: Ambar Nightclub, Jack Rabbit Slim's, Villa Nightclub and Lucy's Love Shack | Pasta Ambra | Fish Feast Company | Wallet Wizard | Ambrose Liquor | Ambar Tavern | Ambra University | Ambra Cheese |
Do you wish to do unpaid work for me??? If so, the PM me on this Forum, and then we can get to work, programming for the future of computers go by the name of ThEiMp. This is my ghost writers name. Also my nickname, means that I am: The Imperial of the Technology Industry, so then to make it really short, I just then wrote: The Imp, which is where I get the nickname from...
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
|