Groups | Blog | Home
all groups > dotnet windows forms > june 2004 >

dotnet windows forms : Very simple question about HScrollbar


Sahil Malik
6/15/2004 7:11:57 PM
I am making a user control.

It has a Hscrollbar,
and a label.

and I have a piece of code that links them together as -
private void hScrollBar1_Scroll(object sender,
System.Windows.Forms.ScrollEventArgs e)
{
label1.Text = hScrollBar1.Value.ToString() ;
}

(Also the relevant event handler) .... Sounds pretty simple huh?

Except, the Maximum Value of my scrollbar is 100, but the damn thing won't
scroll beyond 91.

Please help.

- Sahil Malik
Independent Consultant
You can reach me thru my blog - http://dotnetjunkies.com/WebLog/sahilmalik/



Sahil Malik
6/15/2004 10:19:53 PM
Never mind .. I figured it out .. and I HATE how cheesy out of the box
windows forms controls are.

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/



[quoted text, click to view]

Sahil Malik
6/16/2004 10:36:13 AM
When you think of "Maximum" do you think of "Maximum" or "Maximum -
LargeChange + 1". (Badly documented, this is mentioned in the fine print
only)
Also, the scrollbar in datagrids work different, they are "Maximum -
LargeChange". (Not documented at all).

So next time when you ask for a pitcher of beer, I will give you a pitcher
minus a glass plus a peg, but if you order your beer programatically, then
you get a full pitcher.

- Sahil Malik
Independent Consultant
You can reach me thru my blog at -
http://www.dotnetjunkies.com/weblog/sahilmalik/



[quoted text, click to view]

hirf-spam-me-here NO[at]SPAM gmx.at
6/16/2004 11:05:50 AM
* "Sahil Malik" <contactmethrumyblog@nospam.com> scripsit:
[quoted text, click to view]

That's by design:

<URL:http://groups.google.com/groups?selm=CCWfEOXzCHA.1192%40cpmsftngxa08>

--
Herfried K. Wagner [MVP]
AddThis Social Bookmark Button