Главная страница
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.057 c
1-1131126666
Arazel
2005-11-04 20:51
2005.12.04
Control "has no parent window"


2-1132038926
Silvestr
2005-11-15 10:15
2005.12.04
Как в RishEdit поменять цвет определёной строки ?


3-1129808050
Андрей__
2005-10-20 15:34
2005.12.04
Поиск по Blob-полю в Firebird


2-1132218483
ASDF234
2005-11-17 12:08
2005.12.04
Поиск подстроки в строке .


3-1129836987
lra
2005-10-20 23:36
2005.12.04
выборка заданного количества записей с помощью sql-запроса