|
-
Nov 22nd, 2004, 12:24 AM
#1
Panel Scrollbars [Resolved]
How can I detect if the scrollbars are visible or not on a panel
that has the AutoScroll property set to True?
This doesn't work.
VB Code:
If pnlPanel.ScrollStateVScrollVisible = True Then
Thanks in advance
Last edited by RobDog888; Nov 22nd, 2004 at 10:13 PM.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 22nd, 2004, 09:20 AM
#2
ScrollStateVScrollVisible is a constant, not a property or anything. That's why that doesn't work.
If you inherit from Panel, you can check the VScroll and HScroll properties. They are Protected, so you can only access them through inheritance. Otherwise this should work...
VB Code:
Private Declare Function GetWindowLong Lib "user32" Alias "GetWindowLongA" (ByVal hwnd As IntPtr, _
ByVal nIndex As Integer) _
As Integer
Private Const GWL_STYLE As Integer = (-16)
Private Const WS_VSCROLL As Integer = &H200000
Private Sub Panel1_StyleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Panel1.StyleChanged
Me.Text = ((GetWindowLong(Panel1.Handle, GWL_STYLE) And WS_VSCROLL) = WS_VSCROLL)
End Sub
Laugh, and the world laughs with you. Cry, and you just water down your vodka.
Take credit, not responsibility
-
Nov 22nd, 2004, 03:14 PM
#3
This appears to work as well:
VB Code:
If Panel1.DisplayRectangle.Height = Panel1.Size.Height Then
MsgBox("No Scroll")
Else
MsgBox("Scroll")
End If
-
Nov 22nd, 2004, 03:28 PM
#4
Thanks guys. I will try out both versions tonight when I get home.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Nov 22nd, 2004, 09:39 PM
#5
Ok, I got both of them to work. I guess its just personal preference
of which programming logic to use.
Thanks guys for the help.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|