How can I tell if the scroll bars are visible on my NextGrid? I'd like to be able to automatically adjust column widths so that once the vertical scroll bar is visible so that the useless (in my case) horizontal scroll bar does not appear? I've done this before myself, calculating how many cells my grid can display without a scroll bar, then adjusting column widths accordingly.
While I am asking, how can I find out how wide the scroll bars are? In the past I figured this out by trial and error and defined a constant to hold that value. That might be OK in some cases but in Vista or other OS's the scroll bar widths may be different.
Thanks.
ScrollBars visible?
Started by m610, Jun 22 2009 07:15 AM
5 replies to this topic
#1
Posted 22 June 2009 - 07:15 AM
#2
Posted 22 June 2009 - 04:22 PM
Hello m610,
You may read VertScrollBar or HorzScrollBar public properties. You may write something like:
I hope that this helps.
Best regards
You may read VertScrollBar or HorzScrollBar public properties. You may write something like:
CODE
if NextGrid1.HorzScrollBar.Visible then ...
I hope that this helps.
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#3
Posted 14 July 2009 - 01:18 AM
This function call returns the width of windows' scrollbars:
sbwidth := GetSystemMetrics(SM_CXVSCROLL);
It seems to work for me.
sbwidth := GetSystemMetrics(SM_CXVSCROLL);
It seems to work for me.
#4
Posted 14 July 2009 - 08:21 AM
Hello Jordan,
Yes, this function should work fine.
Best regards
Yes, this function should work fine.
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
#5
Posted 18 July 2009 - 12:25 AM
The NextGrid.InnerWidth property will give you the number of pixels available. When I tried it, it seemed to take into account both the vertical scroll bar and the indicator column.
#6
Posted 18 July 2009 - 10:58 AM
Hello Jordan,
Yes, you are correct. It only exclude grid borders.
Best regards
Yes, you are correct. It only exclude grid borders.
Best regards
boki@bergsoft.net | LinkedIn Profile
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
--
BergSoft Home Page: www.bergsoft.net
Users Section: users.bergsoft.net
Articles and Tutorials: help.bergsoft.net (Developers Network)
--
BergSoft Facebook page
--
Send us applications made with our components and we will submit them on: www.bergsoft.net/apps.htm. Link to this page will be also set on home page too.
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users











