"Barguast" <It*****************@Email.com> wrote in message
news:5A**********************************@microsof t.com...
Probably, but it'd likely involve some pretty nasty Win32 code. Are you
sure
that this is so important?
It is pretty important. I've made a 'table' control that itself contains a
number of 'cell' controls. I'm trying to enable the ability to select a
block
of cells like you would in a spreadsheet (hold the mouse button down over
one
cell, release it over another cell, and select all the cells inbetween). I
was hoping to use the MouseEnter event of a cell to detect when the block
selection had changed but, as I said, the event won't trigger when the
mouse
button is pressed down :(
An easier option would be to have the table draw the cells, rather than have
them as separate controls.
Anyway, if you decide you have to follow your current route, I can't help
you much more than indicate the direction of your research:
- Have a look at ReleaseCapture and SetCapture. Calling ReleaseCapture when
the mouse exits the cell will allow other cells to received it's events.
However it'll stop the original control receiving the MouseUp event. You can
probably pass this message on to the original window.
- Have a look at the WM_LBUTTONUP message.
What I *think* you might have to do is track that a MouseDown occurs, then
call ReleaseCapture on the starting control. Then, once the button is
actually released, pass the WM_LBUTTONUP message to the original control.
Note that it might be possible to do without this step. However, if not, you
might need to trap the WM_LBUTTONUP messages, since the .NET control your
mouse is over might not pass them through if they're not matched with a
corresponding WM_LBUTTONDOWN message.