Login ProductsSalesSupportDownloadsAbout |
Home » Technical Support » Elevate Web Builder Technical Support » Support Forums » Elevate Web Builder General » View Thread |
Messages 1 to 10 of 14 total |
TEdit UPPERCASE data entry |
Thu, Aug 6 2015 8:30 PM | Permanent Link |
Trinione | Hi:
How can data be captured in UPPERCASE using the TEdit component? I am trying to use the KeyPress event with no success. function TfrmMain.edtLastNameKeyPress(Sender: TObject; Key: Char; ShiftKey, CtrlKey, AltKey: Boolean): Boolean; begin Key := UpperCase(Key)[1]; result := true; end; |
Thu, Aug 6 2015 9:19 PM | Permanent Link |
Trinione | That should have been:
begin Key := UpperCase(Key); result := true; end; |
Fri, Aug 7 2015 1:49 AM | Permanent Link |
Michael Dreher | Trinione wrote:
// Hi: // How can data be captured in UPPERCASE using the TEdit component? // // I am trying to use the KeyPress event with no success. // // function TfrmMain.edtLastNameKeyPress(Sender: TObject; Key: Char; ShiftKey, CtrlKey, // AltKey: Boolean): // Boolean; // begin // Key := UpperCase(Key)[1]; // result := true; // end; The reason must be, that "Key" has local scope to the event handler function (call by value semantics). In contrast to the Delphi pascal TEdit::OnKeyPress handler, Key is call by reference parameter (var key :char). I suggest using the OnExit handler like this: procedure TForm1.edLastNameExit(Sender: TObject); begin edLastName.Text := UpperCase(edLastName.Text); end; You'll get (and it's displayed) the uppercase value, but not every key stroke. Michael Dreher |
Fri, Aug 7 2015 6:52 AM | Permanent Link |
Walter Matte Tactical Business Corporation | In the OnChange Event: Edit1.Text := Uppdate(Edit1.Text); This will show for every keystroke. Walter |
Fri, Aug 7 2015 6:53 AM | Permanent Link |
Walter Matte Tactical Business Corporation | Walter Matte wrote:
In the OnChange Event: Edit1.Text := Uppercase(Edit1.Text); This will show for every keystroke. Walter |
Fri, Aug 7 2015 7:56 AM | Permanent Link |
Malcolm Taylor | I am using both OnChange and OnExit (not together) but I am aiming
mostly at mobile devices so have to deal with the virtual keyboard. What I am missing is a convenient 'Done' key. I see that using InputType=tiNumber gives me a working Tab key which allows me to move from one TEdit to the next one. But I can't see how to get that working for the other ti* elements - the green button tap gets swallowed somewhere so maybe I am missing some property setting. I have tried a number of things with little luck. So far as the upper case question is concerned, I did try to use OnKeyDown to set ShiftKey = True but I could not get that to work. |
Fri, Aug 7 2015 10:25 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | << How can data be captured in UPPERCASE using the TEdit component? >>
OnKeyPress has a serious bug in it that will be fixed in 2.01: http://www.elevatesoft.com/forums?action=view&category=ewb&id=ewb_general&page=1&msg=6260#6260 Tim Young Elevate Software www.elevatesoft.com |
Fri, Aug 7 2015 10:27 AM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | However, as Michael points out - you can't do what you're trying to do. The browser does not let you modify keystrokes "in-place" like Windows.
Tim Young Elevate Software www.elevatesoft.com |
Fri, Aug 7 2015 1:56 PM | Permanent Link |
Trinione | Thanks all. I would use the OnChange event to effect the uppercase.
Tim: Could this be a future TEdit Property (Version 2.04) ? It would be easier to set a property on a field like this rather than having to do it by code. |
Fri, Aug 7 2015 2:04 PM | Permanent Link |
Tim Young [Elevate Software] Elevate Software, Inc. timyoung@elevatesoft.com | Trinione wrote:
<< Could this be a future TEdit Property (Version 2.04) ? It would be easier to set a property on a field like this rather than having to do it by code. >> Yeah, I'll probably add some formatting to the inputs when I deal with some of the TDataSet limitations. Tim Young Elevate Software www.elevatesoft.com |
Page 1 of 2 | Next Page » | |
Jump to Page: 1 2 |
This web page was last updated on Wednesday, April 24, 2024 at 11:07 AM | Privacy PolicySite Map © 2024 Elevate Software, Inc. All Rights Reserved Questions or comments ? E-mail us at info@elevatesoft.com |