
27.07.2012, 13:33
|
 |
Let Me Show You
|
|
Регистрация: 30.04.2010
Адрес: Северодвинск
Сообщения: 5,426
Версия Delphi: 7, XE5
Репутация: 59586
|
|
Код:
type
TForm1 = class(TForm)
ComboBox1: TComboBox;
Memo1: TMemo;
procedure ComboBox1Select(Sender: TObject);
procedure ComboBox1KeyPress(Sender: TObject; var Key: Char);
private
{ Private declarations }
procedure SetDef(var Msg: TMessage); message WM_USER+$1001;
public
{ Public declarations }
end;
...
procedure TForm1.SetDef(var Msg: TMessage);
begin
ComboBox1.Text:='d:\Documents';
Memo1.Lines.Add(ComboBox1.Text);
end;
procedure TForm1.ComboBox1Select(Sender: TObject);
begin
if not DirectoryExists(ComboBox1.Text) then
PostMessage(Handle, WM_USER+$1001, 0, 0)
else
Memo1.Lines.Add(ComboBox1.Text);
end;
procedure TForm1.ComboBox1KeyPress(Sender: TObject; var Key: Char);
begin
if Key=#13 then ComboBox1Select(ComboBox1);
end;
оно?
http://zalil.ru/33615616
__________________
Пишу программы за еду.
__________________
|