Articles   Members Online:
-Article/Tip Search
-News Group Search over 21 Million news group articles.
-Delphi/Pascal
-CBuilder/C++
-C#Builder/C#
-JBuilder/Java
-Kylix
Member Area
-Home
-Account Center
-Top 10 NEW!!
-Submit Article/Tip
-Forums Upgraded!!
-My Articles
-Edit Information
-Login/Logout
-Become a Member
-Why sign up!
-Newsletter
-Chat Online!
-Indexes NEW!!
Employment
-Build your resume
-Find a job
-Post a job
-Resume Search
Contacts
-Contacts
-Feedbacks
-Link to us
-Privacy/Disclaimer
Embarcadero
Visit Embarcadero
Embarcadero Community
JEDI
Links
How to Check if scrollbars are present in a TListView Turn on/off line numbers in source code. Switch to Orginial background IDE or DSP color Comment or reply to this aritlce/tip for discussion. Bookmark this article to my favorite article(s). Print this article
31-Oct-02
Category
VCL-General
Language
Delphi 2.x
Views
100
User Rating
No Votes
# Votes
0
Replies
0
Publisher:
DSP, Administrator
Reference URL:
DKB
			Author: Tomas Rutkauskas

Is there a way to determine if the scrollbars are present with a TListView 
component? If so, is it possible to be specific enough to determine which one is 
present, i.e vertical scroll or horizontal scroll?

Answer:

Yes to both:

1   {Function WindowScrollbars
2   
3   Parameters:
4   Window handle of control or window to check.
5   
6   Returns:
7   The TScrollstyle describing the current scrollbar configuration, either ssNone, 
8   ssHorizontal, ssVertical, ssBoth.
9   
10  Description:
11  Checks the WS_VSCROLL and WS_HSCROLL style bits of the window style.
12  
13  Error Conditions: none
14  Created: 21.10.99 by P. Below}
15  
16  function WindowScrollbars(wnd: HWND): TScrollStyle;
17  var
18    styleflags: DWORD;
19  begin
20    styleflags := GetWindowLong(wnd, GWL_STYLE) and (WS_VSCROLL or WS_HSCROLL);
21    case styleflags of
22      0: Result := ssNone;
23      WS_VSCROLL: Result := ssVertical;
24      WS_HSCROLL: Result := ssHorizontal;
25    else
26      Result := ssBoth;
27    end;
28  end;


Call with listview.handle as parameter.

			
Vote: How useful do you find this Article/Tip?
Bad Excellent
1 2 3 4 5 6 7 8 9 10

 

Advertisement
Share this page
Advertisement
Download from Google

Copyright © Mendozi Enterprises LLC