Delphi Pages Forums  

Go Back   Delphi Pages Forums > Delphi Forum > General

Lost Password?

Reply
 
Thread Tools Display Modes
  #1  
Old 01-06-2001, 02:25 PM
elif elif is offline
Junior Member
 
Join Date: Jan 2001
Posts: 8
Default Edit Box

Hi!
I wanto take anything from user ,write to editbox, after
finishing writing just press enter and for example something is active?
Anybody know how that
Reply With Quote
  #2  
Old 01-06-2001, 07:39 PM
douglas douglas is offline
Senior Member
 
Join Date: Jul 2001
Posts: 7,695
Default RE: Edit Box

Your question seems simple as far as I understand what you are saying.

Just place code on the OnKeyPress Event like this:

if Key = #13 then
begin
Key := #0;
CheckBox1.Checked := True;
end;

Write in any code you want once they push enter. #13 is the enter key in ASCII.
Reply With Quote
  #3  
Old 01-07-2001, 09:31 PM
digitiger digitiger is offline
Senior Member
 
Join Date: Jan 2001
Posts: 716
Default RE: RE: Edit Box

the first answere solves the problem but just in case you need something else
then instead of checkbox1.checked you can say
if ord(key) = 13 then // check if enter key is pressed
begin
key = #0 // avoid a beep which comes by default if enter is pressed in edit control

button1.setfocus // to move focus to some other control
or
edit1.color := clwindow // to change the color of editbox
or
edit2.setfocus // to set the focus to next edit box
or
edit2.color := claqua //to change the color of next editbox
etc
etc
end
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On

Forum Jump


All times are GMT. The time now is 04:24 PM.


Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2019, vBulletin Solutions, Inc.