Вниз
Скачать: 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.019 c
4-1083244710
Apollo
2004-04-29 17:18
2004.06.06
wcrypt2.pas


3-1084453609
юрок
2004-05-13 17:06
2004.06.06
bd


1-1085423020
Олег
2004-05-24 22:23
2004.06.06
Как устранить мерцание формы при смене её стиля в runtime ?


14-1085165905
Undert
2004-05-21 22:58
2004.06.06
Обращение Жириновского к Билли ГеЙтсу.


14-1084995538
Piter
2004-05-19 23:38
2004.06.06
"Семь" ("Seven") с Морганом Фрименом и Бредом Питом




   Наверх