Recent

Author Topic: Get the width of scrollbar  (Read 698 times)

mosquito

  • Full Member
  • ***
  • Posts: 141
Get the width of scrollbar
« on: October 09, 2022, 11:48:27 pm »
Hi, how can i get the actual width of scrollbar of a control. I need for Windows and Linux. Independently of widgetset used. Also would be interesting know by code if the scrollbar is actually vissible or not.
« Last Edit: October 09, 2022, 11:50:15 pm by mosquito »

jamie

  • Hero Member
  • *****
  • Posts: 6128
Re: Get the width of scrollbar
« Reply #1 on: October 09, 2022, 11:56:10 pm »
VertScrollBar.ClientSize......

look at the inners there, you can get the client size with or without scrollbar.
The only true wisdom is knowing you know nothing

mosquito

  • Full Member
  • ***
  • Posts: 141
Re: Get the width of scrollbar
« Reply #2 on: October 10, 2022, 12:02:12 am »
@jamie - thanks, but unfortunately my control (TipHtmlPanel) haven't VertScrollBar exposed.
« Last Edit: October 10, 2022, 12:07:16 am by mosquito »

paweld

  • Hero Member
  • *****
  • Posts: 991
Re: Get the width of scrollbar
« Reply #3 on: October 10, 2022, 12:28:21 am »
Code: Pascal  [Select][+][-]
  1. uses
  2. LCLType, LCLIntf;
  3.  
  4. ...
  5.   ShowMessage(IntToStr(GetSystemMetrics(SM_CXVSCROLL)))b  
  6. ...
  7.  
Best regards / Pozdrawiam
paweld

mosquito

  • Full Member
  • ***
  • Posts: 141
Re: Get the width of scrollbar
« Reply #4 on: October 10, 2022, 09:15:32 am »
@paweld - That's work fine for me. Works on Linux/Windows.  :)

Do you know if would be possible hide or show scrollbars by code independently of the properties of control (IpHtmlPanel) ?

I tried with unit LCLIntf [ EnableScrollBar() , ShowScrollBar() ] but not luck.

 

TinyPortal © 2005-2018