Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

TTreeView thumb size

Posted on 2001-08-19
7
Medium Priority
?
323 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_
[X]
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
  • 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
What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

 

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 150 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

Enroll in October's Free Course of the Month

Do you work with and analyze data? Enroll in October's Course of the Month for 7+ hours of SQL training, allowing you to quickly and efficiently store or retrieve data. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
How to fix incompatible JVM issue while installing Eclipse While installing Eclipse in windows, got one error like above and unable to proceed with the installation. This video describes how to successfully install Eclipse. How to solve incompa…
Screencast - Getting to Know the Pipeline
Suggested Courses

610 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