![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
Как удалить полосы прокрутки в компоненте treeview?
VictoR407 © (2008-04-17 13:46:00)Ввожу длинное имя ветки в treeview. Появляются полосы прокрутки. После ввожу короткое имя ветки. Полося прокрутки не исчезают. Как полосы скрыть?
Kolan (2008-04-17 14:11:00) [1]Я делал так:
unit KNoHScrollTreeView;
interface
uses
Windows, SysUtils, Classes, Controls, ComCtrls, Messages;
type
TNoHScrollTreeView = class(TTreeView)
private
{ Private declarations }
protected
{ Protected declarations }
procedure WMNCCalcSize(var msg: TMessage); message WM_NCCALCSIZE;
public
{ Public declarations }
published
{ Published declarations }
end;
procedure Register;
implementation
procedure Register;
begin
RegisterComponents('KSoftWare', [TNoHScrollTreeView]);
end;
{ TNoHScrollTreeView }
procedure TNoHScrollTreeView.WMNCCalcSize(var msg: TMessage);
var
Style: Integer;
begin
Style := GetWindowLong(Handle, GWL_STYLE );
if (Style and WS_HSCROLL) <> 0 then
SetWindowLong(Handle, GWL_STYLE, style and not WS_HSCROLL);
inherited;
end;
end.