How can I make an edit box so that when I hit enter with the cursor still in it. Then it goes to that website in the webbrowser which was in the edit box?
can anyone help me?
You should use the OnKeyPress
event instead of the OnKeyDown
event:
procedure TForm1.Edit1KeyPress(Sender: TObject; var Key: Char);
begin
if ord(Key) = VK_RETURN then
begin
Key := #0; // prevent beeping
WebBrowser1.Navigate(Edit1.Text);
end;
end;