TMaskEdit.EditMask問題 |
答題得分者是:pceyes
|
vmp
一般會員 ![]() ![]() 發表:11 回覆:18 積分:5 註冊:2008-06-10 發送簡訊給我 |
|
pceyes
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:70 回覆:657 積分:1140 註冊:2003-03-13 發送簡訊給我 |
問前先搜一下吧!
Delphi 新手問題 / 作業研討 » TMaskEdit.EditMask日期格式問題 http://delphi.ktop.com.tw/board.php?cid=30&fid=1498&tid=94419
------
努力會更接近成功 |
vmp
一般會員 ![]() ![]() 發表:11 回覆:18 積分:5 註冊:2008-06-10 發送簡訊給我 |
|
pceyes
尊榮會員 ![]() ![]() ![]() ![]() ![]() ![]() 發表:70 回覆:657 積分:1140 註冊:2003-03-13 發送簡訊給我 |
1 = 會存入格式跟資料
0 = 只會存輸入的資料 舉個例子吧 !\(999\)000-0000;1;_ (007)666-1234 1 = (007)666-1234 0 = 0076661234 對了,你的問題的例子,答案是沒有差別! Sample : Unit1.pas [code delphi] unit Unit1; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, StdCtrls, Mask; type TForm1 = class(TForm) MaskEdit1: TMaskEdit; Label1: TLabel; Label2: TLabel; MaskEdit2: TMaskEdit; Button1: TButton; Edit1: TEdit; Edit2: TEdit; Button2: TButton; procedure Button1Click(Sender: TObject); procedure Button2Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var Form1: TForm1; implementation {$R *.dfm} procedure TForm1.Button1Click(Sender: TObject); begin edit1.Text := MaskEdit1.text; end; procedure TForm1.Button2Click(Sender: TObject); begin edit2.Text := MaskEdit2.text; end; end. [/code] Unit1.dfm [code delphi] object Form1: TForm1 Left = 192 Top = 114 Width = 696 Height = 480 Caption = 'Form1' Color = clBtnFace Font.Charset = DEFAULT_CHARSET Font.Color = clWindowText Font.Height = -11 Font.Name = 'MS Sans Serif' Font.Style = [] OldCreateOrder = False PixelsPerInch = 96 TextHeight = 13 object Label1: TLabel Left = 80 Top = 104 Width = 6 Height = 13 Caption = '0' end object Label2: TLabel Left = 80 Top = 192 Width = 6 Height = 13 Caption = '1' end object MaskEdit1: TMaskEdit Left = 168 Top = 104 Width = 215 Height = 21 EditMask = '!\(999\)000-0000;0;_' MaxLength = 13 TabOrder = 0 end object MaskEdit2: TMaskEdit Left = 168 Top = 184 Width = 215 Height = 21 EditMask = '!\(999\)000-0000;1;_' MaxLength = 13 TabOrder = 1 Text = '( ) - ' end object Button1: TButton Left = 416 Top = 104 Width = 49 Height = 25 Caption = 'Button1' TabOrder = 2 OnClick = Button1Click end object Edit1: TEdit Left = 488 Top = 104 Width = 129 Height = 21 TabOrder = 3 Text = 'Edit1' end object Edit2: TEdit Left = 488 Top = 184 Width = 145 Height = 21 TabOrder = 4 Text = 'Edit2' end object Button2: TButton Left = 416 Top = 184 Width = 57 Height = 25 Caption = 'Button2' TabOrder = 5 OnClick = Button2Click end end [/code]
------
努力會更接近成功
編輯記錄
pceyes 重新編輯於 2008-09-17 14:39:16, 註解 無‧
|
vmp
一般會員 ![]() ![]() 發表:11 回覆:18 積分:5 註冊:2008-06-10 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |