Вниз
Скачать: 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 вся ветка

Скачать: CL | DM;



Память: 0.45 MB
Время: 0.02 c
1-1085422899
td
2004-05-24 22:21
2004.06.06
Help в html


4-1082803252
com
2004-04-24 14:40
2004.06.06
Security Descriptor


14-1084859063
WondeRu
2004-05-18 09:44
2004.06.06
Мисс Америка 2004


3-1084473656
BBCHa
2004-05-13 22:40
2004.06.06
Interbase


14-1084766340
Dmitriy O.
2004-05-17 07:59
2004.06.06
Реально ли вырастить капусту на Марсе ?




   Наверх