Главная страница
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.103 c
14-1132034484
Булат Шакиров
2005-11-15 09:01
2005.12.04
Ищу задачники по программированию, Очень срочно!


10-1108642942
Карелин Артем
2005-02-17 15:22
2005.12.04
Авторизация для вызова удаленного com-интерфейса. Как?


2-1131959285
zsergey
2005-11-14 12:08
2005.12.04
Как правильно прописать относительный путь...


14-1131838128
Германн
2005-11-13 02:28
2005.12.04
Error 10106. Помогите кто может!


1-1131070651
Andreika_
2005-11-04 05:17
2005.12.04
dll + xml = Debugged Fault Notification