Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8508713
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T03:14:08+00:00 2026-06-11T03:14:08+00:00

I have a custom control derived from TScrollBox. At run time, I need to

  • 0

I have a custom control derived from TScrollBox. At run time, I need to know weather the vertical scrollbar is visible or not. If I interrogate the Visible property it always returns true, no matter if the scrollbar is visible or not!

function TMyScrollPanel.ScrollVisible: boolean;
begin
 Result:=  Self.VertScrollBar.Visible;            <----------- always true
end;

However, this works correctly:

function VertScrollBarVisible(WindowHandle: THandle): Boolean;                  
begin
 Result:= (GetWindowlong(WindowHandle, GWL_STYLE) AND WS_VSCROLL) <> 0
end;

What is wrong with the first function?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T03:14:10+00:00Added an answer on June 11, 2026 at 3:14 am

    Reading a scrollbar Visible property only retrives VCL control state. The property won’t retrieve the current state from the actual scrollbar window. Use the IsScrollBarVisible property instead.

    Use the IsScrollBarVisible method instead, to check whether a scrollbar is visible because the scrollable window can be scrolled.

    Reading the Visible property only retrieves the cached value of its visibility setting (can be visible or not). For a scrollable window, the property won’t retrieve the current state from the actual window.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a Custom control derived from wxControl,inside a dialog with a vertical sizer
I have custom control derived from Panel and I need to handle selecting with
I have a custom control derived from Button: class MyControl : Button{} And suppose,
I'm creating a custom control called FooControl derived from ItemsControl have a default style
I have a class derived from slider which uses a custom control template and
I have a control derived from a CWnd object that has its custom implemented
I have my own custom control derived from System.Windows.Forms.TreeView which is present on the
I have a custom control that is derived from TabItem , and I want
I have a custom control that is derived from ListView . This list view
I have a calendar control derived from DataGridView. A custom item hover event is

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.