
07.09.2011, 16:54
|
 |
Новичок
|
|
Регистрация: 16.09.2010
Сообщения: 61
Репутация: 10
|
|
Цитата:
Сообщение от Страдалецъ
В общем примерно так:
Код:
procedure TForm1.RichEdit1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
var
Coords: TPoint;
begin
if (Shift = [ssCtrl]) and (Key = VK_SPACE)
then begin
RichEdit1.Perform(EM_POSFROMCHAR, WPARAM(@Coords), RichEdit1.SelStart);
ListBox1.Left := RichEdit1.Left + Coords.X;
ListBox1.Top := RichEdit1.Top + Coords.Y;
ListBox1.Show;
ListBox1.SetFocus
end;
end;
procedure TForm1.ListBox1KeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
case Key
of VK_ESCAPE: ;
VK_RETURN: RichEdit1.SelText := ListBox1.Items[ListBox1.ItemIndex];
else Exit;
end;
ListBox1.Visible := False;
RichEdit1.SetFocus;
end;.
|
Благодарю!!!
|