TEdit . / .
Text, . OnChange , . , :
var
OldText: String;
procedure TForml.EditlChange(Sender: TObject);
begin
if Editl.Text <> '' then
try
StrToFloat(Editl.Text);
OldText:= Editl.Text
except
// :
Editl.Text:= OldText;
// :
Editl.SelStart:= Length(Editl.Text);
Editl.SelText:= ''
end
end;
OldText string, . private .
TEdit
property AutoSelect: Boolean; | , |
property AutoSize: Boolean; | True BorderStyle= bsSingle, Font.Size |
property CanUndo: Boolean; | True, Text Undo |
TEditCharCase = (ecNormal, ecUpperCase, ecLowerCase); property CharCase: TEditCharCase; | : ecNormal ; ecUpperCase ; ecLowerCase . |
property HideSelection: Boolean; | False, |
property MaxLength: Integer; | . 0, |
property Modified: Boolean; | True, |
property PasswordChar: Char; | char , . |
property Readonly: Boolean; | True, |
property SelLength: Integer; | |
property SelStart: Integer; | |
property SelText: String | |
property Text: String; |
Tedit
procedure Clear; | |
procedure ClearSelection; | |
procedure ClearUndo; | Undo |
procedure CopyToClipboard; | |
procedure CutToClipboard; | , |
function GetSelTextBuf (Buffer: PChar; BufSize: Integer): Integer; | BufSize Buffer |
procedure PasteFromClipboard; | , , |
procedure SelectAll; | |
procedure SetSelTextBuf (Buffer: PChar); | Buffer, , Buffer |
procedure Undo; | , |
|
|
3 MaskEdit
TMaskEdit , - , EditMask: string. , TMaskEdit TEdit. IsMasked: Boolean True, . EditText: string (. . , ), Text: string ( ) , .
, (;). , 0 1, , Text (1) (0). , -, ( ). , :
(095) XXX-XX-XX
.
, . , ( ). , , . , , , \. .
4 Memo
TMemo , / .
Lines Tstrings , , ( ).
BorderStyle, CanUndo, HideSelection, MaxLentgh, Modified, OnChange, Readonly, SelLength, SelStart SelText TEdit.
wordwrap TLabel.Wordwrap. .
|
|
M
property Lines: TStrings; | |
TScrollStyle = (ssNone, ssHorizontal, ssVertical, ssBoth); property ScrollBars: TScrollStyle; | 1 ssNone , ssHorizontal ; ssVertical ; ssBoth |
property Text: String; | Lines , EOL (CR+LF) |
property WantReturns: Boolean; | True, <Enter> , . <Ctrl>+<Enter> |
property WantTabs: Boolean; | True, <> , . <Ctrl>+<Tab> |
TControl, Text, . #13#10 ( eoln ) , Lines 0, 1, Lines.Count.
LoadFromFile SaveToFile Tstrings.
: 1, .41-52.
:
1. Edit, ?
2. Memo, ?
3. Lines Memo?
4. Label?
5. ?