Visual Basic/how to determine if a Flexgrid scrollbar is visible ? 
Author Message
 Visual Basic/how to determine if a Flexgrid scrollbar is visible ?

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



Wed, 14 Dec 2005 19:31:14 GMT  
 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


Thu, 15 Dec 2005 04:21:52 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. When the Treeview scrollbar moves the FlexGrid Scrollbar should also move

2. flexgrid / infinite scrolling / how to trap the scrollbar on the flexgrid

3. Visual Basic 6: DragDrop a cell of a MS FlexGrid

4. I am a technical recruiter and I amseeking a Visual Basic programmer who can also

5. I am lokking for a professional who works with visual basic, poerbuilder, and C++

6. how to make MshFlexgrid scrollbar visible ?

7. Scroll 2 Flexgrids from 1 Scrollbar?

8. flexgrid scrollbar question

9. determine where visual basic was called from

10. determine where visual basic was called from

11. List1.Visible - what am I missing

12. Determining Mouse pos over scrollbar?

 

 
Powered by phpBB® Forum Software