![]() |
|
|
#1
|
||||
|
||||
|
Чет не догоняю... пишу:
Код:
Edit1.Text := '12345'; Edit1.SelStart := length(edtConsole.Text)+1; Ладно, допустим. Пишу так: Код:
Edit1.Text := '12345'; sendmessage(Edit1.Handle,WM_KEYDOWN, VK_END, 0); Как поставить его в самый конец текста? чтобы было не так 1234|5 а так 12345| |
|
#2
|
||||
|
||||
|
Решил проблему:
Код:
key:=VK_END; PressKey(Char(key)); |
|
#3
|
||||
|
||||
|
на Delphi 7 все okay:
Код:
...
type
TForm1 = class(TForm)
Edit1: TEdit;
SpeedButton1: TSpeedButton;
SpeedButton2: TSpeedButton;
procedure SpeedButton1Click(Sender: TObject);
procedure SpeedButton2Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
...
procedure TForm1.SpeedButton1Click(Sender: TObject);
begin
Edit1.Text:='procedure TForm1.SpeedButton1Click(Sender: TObject);';
Edit1.SelStart:=Length(Edit1.Text);
end;
procedure TForm1.SpeedButton2Click(Sender: TObject);
begin
Edit1.Text:='procedure TForm1.SpeedButton1Click(Sender: TObject);';
SendMessage(Edit1.Handle, EM_SETSEL, Length(Edit1.Text), Length(Edit1.Text));
end; |
|
#4
|
||||
|
||||
|
У меня делфа ХЕ. может в ней недосмотр...
|
|
#5
|
||||
|
||||
|
На Delphi 2009 тоже всё нормально
Код:
Edit1.SelStart := Length(Edit1.Text); // и так работает SendMessage(Edit1.Handle, WM_KEYDOWN, VK_END, 0); // и так тоже |
|
#6
|
||||
|
||||
|
Очень странно.
|