Click here to Skip to main content
15,919,028 members
Home / Discussions / C#
   

C#

 
AnswerRe: Check user permission on drives Pin
Dave Kreskowiak17-Aug-11 2:08
mveDave Kreskowiak17-Aug-11 2:08 
QuestionPDF417 Barcode generator SDK. Pin
A.Machan Kachan16-Aug-11 19:49
A.Machan Kachan16-Aug-11 19:49 
AnswerRe: PDF417 Barcode generator SDK. Pin
Richard MacCutchan16-Aug-11 22:37
mveRichard MacCutchan16-Aug-11 22:37 
AnswerRe: PDF417 Barcode generator SDK. Pin
louthy17-Aug-11 2:20
louthy17-Aug-11 2:20 
QuestionException Handling and Logging in windows application Pin
arun_pk16-Aug-11 19:10
arun_pk16-Aug-11 19:10 
AnswerRe: Exception Handling and Logging in windows application Pin
DaveAuld16-Aug-11 19:34
professionalDaveAuld16-Aug-11 19:34 
AnswerRe: Exception Handling and Logging in windows application Pin
jschell17-Aug-11 9:07
jschell17-Aug-11 9:07 
QuestionLinking the scroll bars of two controls Pin
Dewald16-Aug-11 3:58
Dewald16-Aug-11 3:58 
Hi all,

I have two DataGridViews on my form with similar data in each. I'd like to view the same section of both DataGridViews at the same time. In other words, if the scroll bars in one DataGridView is scrolled, I want to set the scroll bars for the other one accordingly.

I found this article which explains how to set scroll bars (using Interop) but I'm either doing something wrong or it's just not working for DataGridViews:
How to change scrollbars position in a multiline textbox[^]

Based on the referenced article, this is block of code I currently have in the Scroll() event handler for but it does nothing:
C#
int orientation = 0;
switch (e.ScrollOrientation)
{
    case ScrollOrientation.HorizontalScroll: orientation = 0; break;
    case ScrollOrientation.VerticalScroll: orientation = 1; break;
}
SetScrollPos(dataGridView2.Handle, orientation, e.NewValue, true);
SendMessage(dataGridView2.Handle, EM_LINESCROLL, 0, e.NewValue);


Could anyone help me out here please?
AnswerRe: Linking the scroll bars of two controls Pin
Luc Pattyn16-Aug-11 4:28
sitebuilderLuc Pattyn16-Aug-11 4:28 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald16-Aug-11 21:55
Dewald16-Aug-11 21:55 
AnswerRe: Linking the scroll bars of two controls Pin
BobJanova16-Aug-11 4:54
BobJanova16-Aug-11 4:54 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald16-Aug-11 22:30
Dewald16-Aug-11 22:30 
GeneralRe: Linking the scroll bars of two controls Pin
BobJanova17-Aug-11 0:03
BobJanova17-Aug-11 0:03 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald17-Aug-11 0:34
Dewald17-Aug-11 0:34 
GeneralRe: Linking the scroll bars of two controls Pin
BobJanova17-Aug-11 3:11
BobJanova17-Aug-11 3:11 
GeneralRe: Linking the scroll bars of two controls Pin
Dewald17-Aug-11 4:00
Dewald17-Aug-11 4:00 
Questionhow to send file from Windows-CE to PC Through Socket Pin
goldsoft16-Aug-11 2:55
goldsoft16-Aug-11 2:55 
AnswerRe: how to send file from Windows-CE to PC Through Socket Pin
BobJanova16-Aug-11 4:36
BobJanova16-Aug-11 4:36 
QuestionAccessing dataset throughout application. Pin
paper6716-Aug-11 2:48
paper6716-Aug-11 2:48 
AnswerRe: Accessing dataset throughout application. Pin
BobJanova16-Aug-11 4:34
BobJanova16-Aug-11 4:34 
QuestionLucene.Net:Using Whitespace analyser wildcardquery is not working Pin
NarVish16-Aug-11 1:47
NarVish16-Aug-11 1:47 
AnswerRe: Lucene.Net:Using Whitespace analyser wildcardquery is not working Pin
Mehdi Gholam6-Sep-11 17:53
Mehdi Gholam6-Sep-11 17:53 
QuestionBoolean conversion Pin
5fingers16-Aug-11 0:28
5fingers16-Aug-11 0:28 
GeneralRe: Boolean conversion Pin
Richard MacCutchan16-Aug-11 1:11
mveRichard MacCutchan16-Aug-11 1:11 
GeneralRe: Boolean conversion Pin
5fingers16-Aug-11 1:23
5fingers16-Aug-11 1:23 

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.