Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

TTreeView thumb size

Posted on 2001-08-19
7
317 Views
Last Modified: 2010-04-06
How can I get height of thumb on the vertical scroll bar on the TTreeView?
0
Comment
Question by:Dmitry_
  • 4
  • 2
7 Comments
 
LVL 4

Expert Comment

by:fva
ID: 6405365
GetSystemMetrics(SM_CYVTHUMB)

F.
0
 

Author Comment

by:Dmitry_
ID: 6405427
The thumb height depends by specific window (window size), how can I get thumb height for specific window?
0
 
LVL 4

Expert Comment

by:fva
ID: 6405475
Oh, sorry. You are right. I guess that the best you can do is to get the scroll-bar page size and deduce from that the size of the thumb. Something like:

var asi:TScrollInfo;

...
asi.cbSize:=sizeof(TScrollInfo);
asi.fMask:=SIF_ALL;
GetScrollInfo(MyTreeView.Handle,SB_VERT,asi);
ThumbSize:=(MyTreeView.Height-2*GetSystemMetrics(SM_CYVSCROLL))/(asi.nMax-asi.nMin)*asi.nPage;

After some adjustments you might get it as you want.

F.
0
Free Tool: SSL Checker

Scans your site and returns information about your SSL implementation and certificate. Helpful for debugging and validating your SSL configuration.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 

Author Comment

by:Dmitry_
ID: 6405906
It's not working, ThumbSize always zero
I'm not understanding how it should work, can you explain, please
Dmitry
0
 
LVL 4

Expert Comment

by:fva
ID: 6405962
Well, it was only a suggestion, not code I have tested or used for myself. The idea is that the thumb size is said (in WinAPI help) to be deduced from the page size. So I was thinking that if you get the page size and relate it somehow to the Min-Max interval then you will get some approximation.

Scrollbar size (without arrows) .......... nMax - nMin
ThumbSize (unknown)....................... nPage

You could step into the code and try to see what does asi contain after the GetScrollInfo call. Maybe nPage is zero and then the idea does not work.

F.
0
 
LVL 4

Accepted Solution

by:
fva earned 50 total points
ID: 6405972
Oh, take a look in WinAPI help at GetScrollInfo call. Maybe you will understand better my intention.

F.
0
 
LVL 17

Expert Comment

by:geobul
ID: 9286801
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

accept fva's comment as answer

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Thanks,

geobul
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

856 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question