Mouse Move

P

Peter

Hello.
I'v got one problem.
On formular I have 2 Picturebox.
I write this code:

Private Sub PictureBox1_MouseDown(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles PictureBox1.MouseDown

PictureBox1.BackColor = System.Drawing.Color.Cyan

End Sub

Private Sub PictureBox2_MouseMove(ByVal sender As Object, ByVal e As
System.Windows.Forms.MouseEventArgs) Handles PictureBox2.MouseMove

PictureBox2.BackColor = System.Drawing.Color.Cyan

End Sub



I want ,that when I click with mouse on picturebox1, this picturebox1 change
color, and When I move with mouse cursor over picturebox2 BUT STILL I HAVE
MOUSEDOWN, Picturebox2 change color,.

Thanks.
 
C

Cor

Hi Peter,

With two empty picturebox this code does exactly what it should do for me.

When I click on picturebox1 it becoms cyan

And when I enter with the mouse picturebox2 it becomes also cyan.

And it stays of course that colour.

I hope this helps?

Cor
 
R

Rado

ok, but I what you write is ok, but I think, that when I click/mousedown/ on
picturebox1 color of this picture is cyan and then still I have mousedown ,
I move with mouse over picturebox2 nothink is doing.
Thanks for answer
 
C

Cor

Hi Peter,

Now I understand what you mean, when you enter the control with the
mousedown (you do not need that picturebox1 one for that), than the move
event is not firing.

I think that should be normal, how would you do a nice drag and drop in
another way?

But just a thought about this.

Cor
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top