I have a dialog with an edit box which I populate from a card swipe. The card swipe enters the details fine, but I want the code to detect when the card is entered and pop up a message.
The card swipe automatically enters an end carriage return , but how can I get this CR to trigger a message box.?
Detect CR
Moderators: Dorian (MJT support), JRL
One way would be to add a button and make it a default. do Adddialoghandler> on the button's OnClick event and spawn your message.
Another way, if you have control of the card swipe wold be to change the enter to a tab then use the OnExit event for the edit box.
Here's a sample for the first method, note that the button must be visible to catch the enter press so if you want it to be unseen move it off dialog.
Another way, if you have control of the card swipe wold be to change the enter to a tab then use the OnExit event for the edit box.
Here's a sample for the first method, note that the button must be visible to catch the enter press so if you want it to be unseen move it off dialog.
Code: Select all
Dialog>Dialog1
object Dialog1: TForm
object Edit1: TEdit
Left = 15
Top = 21
Width = 121
Height = 21
end
object MSButton1: tMSButton
Left = -1000
Default = True
end
end
EndDialog>Dialog1
AddDialogHandler>Dialog1,MSButton1,OnClick,MSG
SRT>MSG
MDL>ok
END>MSG
Show>Dialog1,res1