detecting scrollbars system-option

In System Preferences > General > Show scroll bars, users can set scrollbars visibility according to three options.
Is there a way, at least for Mac, to detect the selected option?
In fact, I set the columnWidth of a listbox (autoHidescrollbar ON) to ignore the scrollbar’s width, but with the “Always” option selected in System Preferences the vertical scrollbar hides part of the last column.
If I could get the way to know if such option has been selected, I could change columnwidth to make room for the scrollbar.
Thanks.

[code] declare function NSClassFromString lib “Cocoa” (className As CFStringRef) As Ptr
declare function preferredScrollerStyle lib “AppKit” selector “preferredScrollerStyle” (cls As Ptr) As integer

dim cls As Ptr = NSClassFromString(“NSScroller”)

dim r As integer = preferredScrollerStyle(cls)

if r = 1 then
//‘automatic…’ or ‘when scrolling’
elseif r = 0 then
//‘always’
end[/code]

[quote=244337:@Carlo Rubini]If I could get the way to know if such option has been selected, I could change columnwidth to make room for the scrollbar.
Thanks.[/quote]
I seem to recall that the listbox already handles this for you, when drawing the row use the graphics.width and you should always get the visible row width. If not then it’s a regression and a Feedback will need to be filled.

@Will Shank Thank you!

@Sam Rowlands I guess I forgot about it. Thanks.

Carlo, since I know you use my OverlayScrollbar class, to fake the 10.7+ OS X scrollbars, look at the code, there is already such detection code.

@Massimo Could you expand? I tried putting the snippet below in the open event of a listbox, but “VerticalBarVisible” is not recognized.
if me.VerticalBarVisible then
//do something
end if

The OverlayScrollbars class contains a method named OverlayEnabled() where you can see how it checks the system setting to show/hide the scrollbars.

OK. I got it. And in a few moments a new mail for you about double-clicking…