Главная страница
Top.Mail.Ru    Яндекс.Метрика
Текущий архив: 2005.12.04;
Скачать: CL | DM;

Вниз

Как программноно передвигаться по индексам TreeView   Найти похожие ветки 

 
Al_Ba ©   (2005-11-17 13:55) [0]

Как программноно передвигаться по индексам TreeView  вниз и вверх. Если можно, то пример ПЛЗ......


 
SergGG   (2005-11-17 15:19) [1]

Может быть так:

var step:integer;

procedure TForm1.DownClick(Sender: TObject);
var i:integer;
begin
   if TreeView1.Items.Item[Step].SelectedIndex=Step then
   begin
     TreeView1.Items.Item[Step].Selected:=True;
     TreeView1.Items.Item[Step].Focused:=True;
   end;
 Step:=step+1;
   if Step=TreeView1.Items.Count then
    Step:=0
end;

procedure TForm1.UpClick(Sender: TObject);
var i:integer;
begin
   if TreeView1.Items.Item[Step].SelectedIndex=Step then
   begin
     TreeView1.Items.Item[Step].Selected:=True;
     TreeView1.Items.Item[Step].Focused:=True;
   end;
 Step:=step-1;
   if Step<0 then
   Step:=TreeView1.Items.Count-1
end;

dfm

object Form1: TForm1
 Left = 192
 Top = 114
 Width = 816
 Height = 500
 Caption = "Form1"
 Color = clBtnFace
 Font.Charset = DEFAULT_CHARSET
 Font.Color = clWindowText
 Font.Height = -11
 Font.Name = "MS Sans Serif"
 Font.Style = []
 OldCreateOrder = False
 PixelsPerInch = 96
 TextHeight = 13
 object TreeView1: TTreeView
   Left = 48
   Top = 16
   Width = 273
   Height = 217
   HideSelection = False
   Indent = 19
   MultiSelect = True
   MultiSelectStyle = [msControlSelect, msShiftSelect, msVisibleOnly, msSiblingOnly]
   TabOrder = 0
   Items.Data = {
     050000001A000000000000000000000000000000FFFFFFFF0000000000000000
     01311A000000000000000100000001000000FFFFFFFF00000000000000000132
     1A000000000000000200000002000000FFFFFFFF000000000000000001331A00
     00000000000003000000FFFFFFFFFFFFFFFF000000000000000001341A000000
     0000000004000000FFFFFFFFFFFFFFFF00000000000000000135}
 end
 object Up: TButton
   Left = 408
   Top = 32
   Width = 75
   Height = 25
   Caption = "Up"
   TabOrder = 1
   OnClick = UpClick
 end
 object Down: TButton
   Left = 408
   Top = 72
   Width = 75
   Height = 25
   Caption = "Down"
   TabOrder = 2
   OnClick = DownClick
 end
end




Страницы: 1 вся ветка

Текущий архив: 2005.12.04;
Скачать: CL | DM;

Наверх




Память: 0.47 MB
Время: 0.048 c
14-1131911771
Knight
2005-11-13 22:56
2005.12.04
Интересно... компании, которые пишут антивири...


14-1131431975
Shopot
2005-11-08 09:39
2005.12.04
Рисование в Delphi.


5-1114854193
B1ack1ceM0de1
2005-04-30 13:43
2005.12.04
Разноцветный ProgressBar


4-1128005817
jack128
2005-09-29 18:56
2005.12.04
Какое сообщение приходит TPageControl у при клике мышой


4-1124699793
ArtemESC
2005-08-22 12:36
2005.12.04
Плавно зарисовать Desktop