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




Reply With Quote