Hi.
I have a trackbar. I need to set trackbar value depending on where
user has clicked on the bar ( mouse_up event for example ). However
avent arguments are telling me only about x and y position and so
on... If i had hittest method i could try to work it out... Maybe you
will know how to do described task?
Regards
PK
Piotrekk,
You should be able to call SendMessage through the P/Invoke layer,
passing the TBM_GETPTICS message. From there, you will have the locations
of all the tics, and you can then calculate your location with the x
position (the y position shouldn't matter, unless this was a vertical
trackbar, in which case the returned array of tics would be compared to the
y value).
You will, of course, have to use the Marshal class to marshal the array
into managed code to do your comparisons.

Signature
- Nicholas Paldino [.NET/C# MVP]
- mvp@spam.guard.caspershouse.com
> Hi.
> I have a trackbar. I need to set trackbar value depending on where
[quoted text clipped - 4 lines]
> Regards
> PK
Piotrekk - 25 Jul 2007 18:35 GMT
> You should be able to call SendMessage through the P/Invoke layer,
> passing the TBM_GETPTICS message. From there, you will have the locations
[quoted text clipped - 5 lines]
> You will, of course, have to use the Marshal class to marshal the array
> into managed code to do your comparisons.
Looks complicated but i will give it a shot.
Thanks