Solved

TTreeView thumb size

Posted on 2001-08-19
7
313 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
Comment Utility
GetSystemMetrics(SM_CYVTHUMB)

F.
0
 

Author Comment

by:Dmitry_
Comment Utility
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
Comment Utility
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
What Security Threats Are You Missing?

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 

Author Comment

by:Dmitry_
Comment Utility
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
Comment Utility
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
Comment Utility
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
Comment Utility
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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

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…
This article explains how to create forms/units independent of other forms/units object names in a delphi project. Have you ever created a form for user input in a Delphi project and then had the need to have that same form in a other Delphi proj…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now