RobYost Posted May 24, 2017 Share Posted May 24, 2017 I am trying to use the keypress event to disallow some keys in a TUniDateTimePicker. But even if I use: procedure TfraTIncome.edtDatePaidKeyDown(Sender: TObject; var Key: Word; Shift: TShiftState); begin Key := 0; end; procedure TfraTIncome.edtDatePaidKeyPress(Sender: TObject; var Key: Char); begin Key := #0; end; It still lets me type anything. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted May 24, 2017 Share Posted May 24, 2017 Hi, Can you try this approach for now ?!: http://forums.unigui.com/index.php?/topic/8377-how-to-keep-the-slash-mask-in-tunidatetimepicker-while-the-user-typing/&do=findComment&comment=42943 Best regards, 1 Quote Link to comment Share on other sites More sharing options...
RobYost Posted May 25, 2017 Author Share Posted May 25, 2017 Thanks that works, is there a way to pass the date format as an option? Depending on the local format I would like this to change. Quote Link to comment Share on other sites More sharing options...
GerhardV Posted May 25, 2017 Share Posted May 25, 2017 By the way Rob - since these are now web apps, you really don't want to go down the road of trapping a key-press event as it will require a trip to the server with every key pressed, for these kind of things it is best to do it on the browser side with JS. It takes some time to get the mindset right but I find myself thinking twice now before just putting some code behind a Delphi event. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.