•
•
•
•
What is DaniWeb IT Discussion Community?
You're currently browsing the Pascal and Delphi section within the Software Development category of DaniWeb, a massive community of 397,818 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,622 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Pascal and Delphi advertiser:
Views: 2034 | Replies: 13
![]() |
thank you for your help and i am trying to learn like i said and i understand a little bit of wut you put but now that i got your help i will use my book that i have been using and see wut you did ya know anhd then figure it out that way thanx again for all your help and if i have any more qs may i ask you?
•
•
Join Date: Apr 2007
Posts: 27
Reputation:
Rep Power: 2
Solved Threads: 1
As long as you're at it, here is how you get the program to run your Prime method when the Enter key is pressed without including a button:
1. Set the KeyPreview property of your form to True.
2. Go to the Events page of the form and double-click in the empty space to the right of the OnKeyDown event. This will create an empty method for this event.
3. In the event Delphi generates, add this code:
if Ord(Key) = VK_Return then (call your Prime function here)
Note that VK_Return is a constant defined as an integer, so you need to cast the Key value passed to your method before you can compare it to the character which you typed.
PS-They still teach Delphi in (good) schools because it is one of the best development tools for Windows and not too bad for Web and NET apps too.
1. Set the KeyPreview property of your form to True.
2. Go to the Events page of the form and double-click in the empty space to the right of the OnKeyDown event. This will create an empty method for this event.
3. In the event Delphi generates, add this code:
if Ord(Key) = VK_Return then (call your Prime function here)
Note that VK_Return is a constant defined as an integer, so you need to cast the Key value passed to your method before you can compare it to the character which you typed.
PS-They still teach Delphi in (good) schools because it is one of the best development tools for Windows and not too bad for Web and NET apps too.
![]() |
•
•
•
•
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
•
•
•
•
•
•
•
•
DaniWeb Pascal and Delphi Marketplace
Other Threads in the Pascal and Delphi Forum
- Previous Thread: 'Database is not in insert or edit mode'
- Next Thread: Importing TLB Files


Linear Mode