Solved

TTreeView thumb size

Posted on 2001-08-19
7
318 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering as a way of saying 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

Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

726 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