if trim(Combobox1.text)='' then num:=0 else if pos('%',combobox1.Text)<>0 then num:=strtofloat(copy(combobox1.Text,1,pos('%',combobox1.Text)-1)) else num:=strtofloat(combobox1.Text);
if pos('%',Combobox1.Text)<>0 then combobox1.MaxLength:=length(combobox1.Text) else begin combobox1.MaxLength:=0; if num>100 then begin messagedlg('大于100!',mtwarning,[mbok],0); key:=#0; combobox1.Text:='';