Click here to Skip to main content
15,927,514 members
Home / Discussions / Windows Forms
   

Windows Forms

 
GeneralRe: Images Changing On Timer Tick Pin
Sachin Dubey24-Sep-09 1:30
Sachin Dubey24-Sep-09 1:30 
GeneralRe: Images Changing On Timer Tick Pin
Ashfield24-Sep-09 1:37
Ashfield24-Sep-09 1:37 
AnswerRe: Images Changing On Timer Tick Pin
Luc Pattyn24-Sep-09 2:03
sitebuilderLuc Pattyn24-Sep-09 2:03 
GeneralRe: Images Changing On Timer Tick Pin
Sachin Dubey24-Sep-09 2:05
Sachin Dubey24-Sep-09 2:05 
QuestionHow to implement an intellisense style popup window? Pin
prabbit201023-Sep-09 20:16
prabbit201023-Sep-09 20:16 
AnswerRe: How to implement an intellisense style popup window? Pin
Shameel19-Oct-09 0:47
professionalShameel19-Oct-09 0:47 
GeneralRe: How to implement an intellisense style popup window? Pin
prabbit201021-Oct-09 0:14
prabbit201021-Oct-09 0:14 
QuestionDataGridView ScrollBars [solved] Pin
PIEBALDconsult23-Sep-09 14:47
mvePIEBALDconsult23-Sep-09 14:47 
I've been playing around with a DataGridView today. Dead | X|

One of the things I noticed is that the ScrollBars behave differently when the thumb is dragged...
The vertical ScrollBar scrolls the rows one whole row at a time.
The horizontal ScrollBar scrolls the columns smoothly (which I suppose is usually the desired behaviour).

Because all my columns are the same width (and narrow -- think of a Scrabble board implemented with a DGV) I would prefer to scroll a whole column at a time.

Has anyone here achieved this?

This isn't actually a big deal, just a "nice to have". (I expect someone at MS considered it a YAGNI.)



Solution:

In my earlier attempts, I had been trying to force the scrollbar to jump by the column width.
Altering the HorizontalScrollingOffset directly to a value that is a multiple of the column width (X below) achieves the desired effect.

private void 
dgResults_Scroll 
( 
    object sender 
, 
    System.Windows.Forms.ScrollEventArgs e 
)
{
    if ( e.ScrollOrientation == System.Windows.Forms.ScrollOrientation.HorizontalScroll )
    {
        this.dgResults.HorizontalScrollingOffset = e.NewValue / X * X ;
    }
             
    return ;
}


modified on Thursday, September 24, 2009 5:21 PM

QuestionWeird blue dots around the OvalShape Pin
lhyblue22-Sep-09 20:50
lhyblue22-Sep-09 20:50 
QuestionIssue in elementhost Pin
rajesh8522-Sep-09 0:25
rajesh8522-Sep-09 0:25 
QuestionHow to set cell value of datagridview on cell double click? Pin
monuSaini21-Sep-09 23:13
monuSaini21-Sep-09 23:13 
AnswerRe: How to set cell value of datagridview on cell double click? Pin
Henry Minute22-Sep-09 0:45
Henry Minute22-Sep-09 0:45 
GeneralRe: How to set cell value of datagridview on cell double click? Pin
monuSaini22-Sep-09 2:21
monuSaini22-Sep-09 2:21 
GeneralRe: How to set cell value of datagridview on cell double click? Pin
Henry Minute22-Sep-09 2:43
Henry Minute22-Sep-09 2:43 
QuestionSaving image to sql server using vb.net Pin
nowords4u21-Sep-09 2:54
nowords4u21-Sep-09 2:54 
AnswerRe: Saving image to sql server using vb.net Pin
bluepoison21-Sep-09 3:21
bluepoison21-Sep-09 3:21 
GeneralRe: Saving image to sql server using vb.net Pin
dan!sh 21-Sep-09 23:12
professional dan!sh 21-Sep-09 23:12 
AnswerRe: Saving image to sql server using vb.net Pin
nowords4u22-Sep-09 10:04
nowords4u22-Sep-09 10:04 
QuestionMake Something Like the Visual Studio Start Page Pin
Brian C Hart18-Sep-09 12:47
professionalBrian C Hart18-Sep-09 12:47 
AnswerRe: Make Something Like the Visual Studio Start Page Pin
Luc Pattyn18-Sep-09 12:54
sitebuilderLuc Pattyn18-Sep-09 12:54 
QuestionRe: Make Something Like the Visual Studio Start Page Pin
Brian C Hart19-Sep-09 8:26
professionalBrian C Hart19-Sep-09 8:26 
AnswerRe: Make Something Like the Visual Studio Start Page Pin
Luc Pattyn19-Sep-09 8:57
sitebuilderLuc Pattyn19-Sep-09 8:57 
QuestionWebBrowser control stopped working Pin
Alan Burkhart17-Sep-09 5:22
Alan Burkhart17-Sep-09 5:22 
AnswerRe: WebBrowser control stopped working Pin
Luc Pattyn17-Sep-09 5:44
sitebuilderLuc Pattyn17-Sep-09 5:44 
GeneralRe: WebBrowser control stopped working Pin
Alan Burkhart17-Sep-09 15:09
Alan Burkhart17-Sep-09 15:09 

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.