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

Вниз

ValueListEditor2   Найти похожие ветки 

 
BFG9k   (2004-05-20 16:10) [0]

ItemProps[i].EditStyle:=esPickList;
    ItemProps[i].PickList:=myStrings;
...появляется ниспадающий список в поле Value , а вот как вызвать его для поля key ?


 
BFG9k   (2004-05-20 18:48) [1]

Нет смысла использовать дурацкий PickList , я использовал комбинацию ValueListEditor+ComboBox (код не оптимизирован) :

procedure TForm1.ComboBox1Exit(Sender: TObject);
begin
 ComboBox1.Hide;
end;

procedure TForm1.ValueListEditor1MouseDown(Sender: TObject;
 Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
var   Rect:TRect;
     LCol,LRow:integer;
begin
 if Button=mbRight then
 begin
 ValueListEditor1.MouseToCell(X,Y,LCol,LRow);
 Rect:=ValueListEditor1.CellRect(LCol,LRow);
 ValueListEditor1.Col:=LCol;
 ValueListEditor1.Row:=LRow;
 ValueListEditor1.Enabled:=false;
 if (LRow=0) then exit;
 with ComboBox1 do
 begin

   Parent:=ValueListEditor1;

   Left:=Rect.Left;
   Top:=Rect.Top;
   Width:=Rect.Right-Rect.Left;
   Height:=100;
   Text:=ValueListEditor1.Cells[LCol,LRow];
   Show;
 end;
 ValueListEditor1.Enabled:=true;
 end;
end;

procedure TForm1.ValueListEditor1Click(Sender: TObject);
begin
ComboBox1.Hide;
end;

procedure TForm1.ComboBox1Change(Sender: TObject);
begin
 with ValueListEditor1 do
   Cells[Col,Row]:=ComboBox1.Text;
end;


 
BFG9k   (2004-05-20 18:52) [2]

Сорри , OnChange не работает , надо так :

procedure TForm1.ComboBox1Exit(Sender: TObject);
begin
 ComboBox1.Hide;
 with ValueListEditor1 do
   Cells[Col,Row]:=ComboBox1.Text;
end;



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

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

Наверх




Память: 0.47 MB
Время: 0.027 c
1-1085136603
S@shka
2004-05-21 14:50
2004.06.06
"Простейший" ScreenSaver


1-1085549054
Vilux
2004-05-26 09:24
2004.06.06
RichEdit->HTML


4-1083758886
Ragazor
2004-05-05 16:08
2004.06.06
Инфа по COM и LPT


14-1084644122
Rouse_
2004-05-15 22:02
2004.06.06
Опрос...


14-1085149876
Rem
2004-05-21 18:31
2004.06.06
А давайте построим космический корабль!