Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the width of a scroll bar?

Status
Not open for further replies.

TimSNL

Programmer
Sep 11, 2001
119
AU
Hello :)

I need to find (at runtime) the width of the vertical scroll bar up the side of my TDBEdit. I need this to dynamically resize the columns to avoid the infamous horizontal scrool bar popping up down the bottom of the grid when I don't want him [thumbsdown].

Thanks for your help :)
Tim Dover
 
Each object that has a canvas has a width property and a clientwidth property. the scrollbar is not parth of the client canvas , therefore the objects width minus the clientwidth is the size of the scroll bar. Normally the is about 20 pixels but the code below will tell you exactly.

Label1.Caption:=IntToStr(MyObject.Width-MyObject.ClientWidth);

Substitute MyObject with the name of the control you are testing.

hope this helps
NeilP

 
Thankyou NeilP [2thumbsup]

That was just the tip i needed to fix my problem.

Well Done :)

Tim Dover
SNL Computing

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top