![]() |
| ||
|
|
Новости |
Поиск |
FAQ |
Статьи |
Книги |
Новости VCL
| | Форумы ЧАТ |
Орешник |
|
| |||
| |||
« предыдущая ветвь | форум | следующая ветвь »
TreeView мультиселект [D7]
Валя © (2016-03-19 13:09:00)Как программно выделить несколько нужных узлов?
Так не работает:
unit Unit1;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ComCtrls, Buttons;
type
TForm1 = class(TForm)
TreeView1: TTreeView;
SpeedButton1: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Form1: TForm1;
implementation
{$R *.dfm}
procedure TForm1.SpeedButton1Click(Sender: TObject);
var
First, Second: TTreeNode;
begin
First := TreeView1.Items.Add(nil, 'First');
Second := TreeView1.Items.Add(nil, 'Second');
TreeView1.MultiSelect := True;
First.Selected := True;
Second.Selected := True;
end;
end.
Игорь Шевченко (2016-03-19 15:03:00) [1]TreeView1.Select([First,Second])