Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 5 of 5 total |
Disable direct edit in TDateEdit |
Sat, Jun 26 2021 7:40 AM | Permanent Link |
StewCam | I wanted to disable direct edit in TDateEdit, so that the user is forced to select a date from the drop down calendar. I found that if I set the OnEnter and OnExit handlers to disable and enable the control respectively, I get the desired effect. However, this feels like a workaround. Is there a more straightforward way?
|
Sun, Jun 27 2021 7:09 PM | Permanent Link |
Alan Questell Richmond Community College | You want to handle the OnKeyDown event and then you can discard anything you want. You can examine Key pressed and discard any that you want to discard.
StewCam wrote: I wanted to disable direct edit in TDateEdit, so that the user is forced to select a date from the drop down calendar. I found that if I set the OnEnter and OnExit handlers to disable and enable the control respectively, I get the desired effect. However, this feels like a workaround. Is there a more straightforward way? |
Mon, Jun 28 2021 8:19 AM | Permanent Link |
StewCam | Thanks for the suggestion. Handling the OnKeyDown is neater. However, the blinking edit cursor and the deletion button (X) are then enabled, which is potentially confusing.
Alan Questell wrote: You want to handle the OnKeyDown event and then you can discard anything you want. You can examine Key pressed and discard any that you want to discard. |
Mon, Jun 28 2021 2:47 PM | Permanent Link |
Alan Questell Richmond Community College | Have you considered an edit control that's read only and then update it from your program when a date is chosen from a calendar control? In other words, break this into two instead of trying to use the one.
StewCam wrote: Thanks for the suggestion. Handling the OnKeyDown is neater. However, the blinking edit cursor and the deletion button (X) are then enabled, which is potentially confusing. Alan Questell wrote: You want to handle the OnKeyDown event and then you can discard anything you want. You can examine Key pressed and discard any that you want to discard. |
Tue, Jun 29 2021 7:24 AM | Permanent Link |
StewCam | Thanks again. In this case I am looking to conserve space in the layout, so will stick with handling OnEnter and OnExit for now.
Alan Questell wrote: Have you considered an edit control that's read only and then update it from your program when a date is chosen from a calendar control? In other words, break this into two instead of trying to use the one. |
This web page was last updated on Tuesday, December 10, 2024 at 04:57 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |