Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Languages / C# / July 2007

Tip: Looking for answers? Try searching our database.

Hittest on trackBar - to set pointer to clicked position

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Piotrekk - 25 Jul 2007 18:09 GMT
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
Nicholas Paldino [.NET/C# MVP] - 25 Jul 2007 18:32 GMT
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

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.