Solved

TTreeView thumb size

Posted on 2001-08-19
7
316 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
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 

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

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

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…
The uses clause is one of those things that just tends to grow and grow. Most of the time this is in the main form, as it's from this form that all others are called. If you have a big application (including many forms), the uses clause in the in…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

813 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

8 Experts available now in Live!

Get 1:1 Help Now