 |
BorlandTalk.com Borland discussion newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
HanslH Guest
|
Posted: Sun Feb 01, 2004 3:04 pm Post subject: pressing a button with enter |
|
|
Hoped I wouldn't be biting my nails off over something so stupid after
one month of delphi (4):
I have a (bitbtn) button on a form type ok. I set it's default
property to true, tab order 0. There is also an edit control and a
cancel button.
If I press enter while the tedit has focus nothing happens. If i give
the button focus with tab and press enter nothing happens . If I make
an on keypress event handler for the button and press enter after
giving focus nothing happens (the debugger doesn't even enter the
event handler, the button doesn't even appear to get pressed). If I
put my keyboard on the sidewalk near a skyscraper end jump on the
enter key from the top nothing happens. What else could i try?
procedure TFormGetText.BitBtn2Click(Sender: TObject);
begin
caption := 'pressed';
end;
procedure TFormGetText.BitBtn2KeyPress(Sender: TObject; var Key:
Char);
begin
if (Key = #13) then begin
caption := 'pressed';
Key := #0;
BitBtn2.Click;
end;
end;
|
|
| Back to top |
|
 |
HanslH Guest
|
Posted: Sun Feb 01, 2004 3:25 pm Post subject: Re: pressing a button with enter |
|
|
Well it seems to be caused by a HandleMessages procedure from another
form which I thought to have been form specific by making it a class
function.
On Sun, 01 Feb 2004 16:04:44 +0100, HanslH <NOSPAMhh_000001 (AT) xs4all (DOT) nl>
wrote:
| Quote: | Hoped I wouldn't be biting my nails off over something so stupid after
one month of delphi (4):
I have a (bitbtn) button on a form type ok. I set it's default
property to true, tab order 0. There is also an edit control and a
cancel button.
If I press enter while the tedit has focus nothing happens. If i give
the button focus with tab and press enter nothing happens . If I make
an on keypress event handler for the button and press enter after
giving focus nothing happens (the debugger doesn't even enter the
event handler, the button doesn't even appear to get pressed). If I
put my keyboard on the sidewalk near a skyscraper end jump on the
enter key from the top nothing happens. What else could i try?
procedure TFormGetText.BitBtn2Click(Sender: TObject);
begin
caption := 'pressed';
end;
procedure TFormGetText.BitBtn2KeyPress(Sender: TObject; var Key:
Char);
begin
if (Key = #13) then begin
caption := 'pressed';
Key := #0;
BitBtn2.Click;
end;
end;
|
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|