Текущий архив: 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.45 MB
Время: 0.029 c