delphi edit 颜色问题
1个回答
展开全部
procedure TForm1.Edit1Change(Sender: TObject);
var
lbl1,lbl2,edt1: String;
cl: TColor;
begin
lbl1 := Label1.Caption;
lbl2 := Label2.Caption;
edt1 := Edit1.Text;
if edt1 = '' then cl := clWhite
else begin
if (edt1 > lbl1) and (edt1 < lbl2) then cl := clGreen
else cl := clRed;
end;
Edit1.Color := cl;
end;
var
lbl1,lbl2,edt1: String;
cl: TColor;
begin
lbl1 := Label1.Caption;
lbl2 := Label2.Caption;
edt1 := Edit1.Text;
if edt1 = '' then cl := clWhite
else begin
if (edt1 > lbl1) and (edt1 < lbl2) then cl := clGreen
else cl := clRed;
end;
Edit1.Color := cl;
end;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询