Click here to Skip to main content
15,890,897 members
Home / Discussions / C#
   

C#

 
GeneralRe: LISTVIEW PLS HELP!!!!!!!!!!!!!!!!!!!!!!! Pin
cristiansje27-Mar-04 23:06
cristiansje27-Mar-04 23:06 
GeneralRe: LISTVIEW PLS HELP!!!!!!!!!!!!!!!!!!!!!!! Pin
cristiansje28-Mar-04 21:22
cristiansje28-Mar-04 21:22 
Questionwebcam problem ? Pin
kendao27-Mar-04 8:37
kendao27-Mar-04 8:37 
AnswerRe: webcam problem ? Pin
Dave Kreskowiak27-Mar-04 8:48
mveDave Kreskowiak27-Mar-04 8:48 
GeneralDataGrid scrolling Pin
quilkin27-Mar-04 3:09
quilkin27-Mar-04 3:09 
GeneralRe: DataGrid scrolling Pin
Heath Stewart27-Mar-04 5:28
protectorHeath Stewart27-Mar-04 5:28 
GeneralRe: DataGrid scrolling Pin
quilkin27-Mar-04 8:20
quilkin27-Mar-04 8:20 
GeneralRe: DataGrid scrolling Pin
Heath Stewart27-Mar-04 8:51
protectorHeath Stewart27-Mar-04 8:51 
For one, you can get the mouse position in screen coordinates at any time from the static Control.MousePosition property, but you didn't read my reply so this really doens't make a difference.

When you scroll, obviously a new row is displayed at the top of the DataGrid, right? All you need to do is call HitTest with the coordinates 1, 1 (or new Point(1, 1) and that will get you the row currently at the top of the DataGrid's view. This is a very simple workaround.

If you want the slider position, simply P/Invoke the SendMessage API and send the SBM_GETPOS message to the DataGrid control using its Handle property (the HWND for the control). This will get you a value of between 0 and 100, so you'll need to take the row height into account and calculate everything, but the workaround above is so much simpler and doesn't require you to P/Invoke anything (making your code more portable).

 

Microsoft MVP, Visual C#
My Articles
GeneralRe: DataGrid scrolling Pin
quilkin27-Mar-04 12:07
quilkin27-Mar-04 12:07 
GeneralOpen Outlook Pin
naresh_pandey1327-Mar-04 1:22
naresh_pandey1327-Mar-04 1:22 
GeneralRe: Open Outlook Pin
Peter Nirschl27-Mar-04 2:54
Peter Nirschl27-Mar-04 2:54 
GeneralRe: Open Outlook Pin
Stefan Troschuetz27-Mar-04 7:56
Stefan Troschuetz27-Mar-04 7:56 
GeneralRe: Open Outlook Pin
basdanny29-Mar-04 2:18
basdanny29-Mar-04 2:18 
GeneralDon't Doubt:Help Me And Get Money Pin
yzs27-Mar-04 0:45
yzs27-Mar-04 0:45 
GeneralRe: Don't Doubt:Help Me And Get Money Pin
Nick Parker27-Mar-04 9:08
protectorNick Parker27-Mar-04 9:08 
GeneralRe: Don't Doubt:Help Me And Get Money Pin
Pradeep C27-Mar-04 15:50
Pradeep C27-Mar-04 15:50 
GeneralProblem using Dll in .net Pin
naresh_pandey1326-Mar-04 21:20
naresh_pandey1326-Mar-04 21:20 
GeneralRe: Problem using Dll in .net Pin
Heath Stewart26-Mar-04 21:40
protectorHeath Stewart26-Mar-04 21:40 
GeneralRe: Problem using Dll in .net Pin
Peter Nirschl27-Mar-04 0:57
Peter Nirschl27-Mar-04 0:57 
GeneralRe: Problem using Dll in .net Pin
Nick Parker27-Mar-04 4:40
protectorNick Parker27-Mar-04 4:40 
GeneralRe: Problem using Dll in .net Pin
Heath Stewart27-Mar-04 5:35
protectorHeath Stewart27-Mar-04 5:35 
GeneralRe: Problem using Dll in .net Pin
Peter Nirschl27-Mar-04 6:20
Peter Nirschl27-Mar-04 6:20 
Generalmove form Pin
Rob Tomson26-Mar-04 20:33
Rob Tomson26-Mar-04 20:33 
GeneralRe: move form Pin
Heath Stewart26-Mar-04 21:10
protectorHeath Stewart26-Mar-04 21:10 
GeneralRe: move form Pin
Rob Tomson26-Mar-04 21:58
Rob Tomson26-Mar-04 21:58 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.