
Visual Basic/how to determine if a Flexgrid scrollbar is visible ?
A Nice fellow programmer helped me out with this one, just use the following
functions.
Option Explicit
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA"
(ByVal hWnd As Long, ByVal nIndex As Long) As Long
Private Const WS_HSCROLL As Long = &H100000
Private Const WS_VSCROLL As Long = &H200000
Private Const GWL_STYLE As Long = -16
Public Function HasHorzScroll(ByVal hWnd As Long) As Boolean
Dim nStyle As Long
nStyle = GetWindowLong(hWnd, GWL_STYLE)
If (nStyle And WS_HSCROLL) <> 0 Then
HasHorzScroll = True
Else
HasHorzScroll = False
End If
End Function
Public Function HasVertScroll(ByVal hWnd As Long) As Boolean
Dim nStyle As Long
nStyle = GetWindowLong(hWnd, GWL_STYLE)
If (nStyle And WS_VSCROLL) <> 0 Then
HasVertScroll = True
Else
HasVertScroll = False
End If
End Function
Quote:
> Hi Fellow confused people,
> Does anybody know how to determine if a scroll bar is visible on a
> mshFlexiGrid? I've tried various methods of counting the column width and
> comparing this to control width, but due to changes in size, borders etc
it
> never is 100% perfect.
> Many Thanks
---
Outgoing mail is certified Virus Free.
Checked by AVG anti-virus system (http://www.grisoft.com).
Version: 6.0.486 / Virus Database: 284 - Release Date: 29/05/2003