procedure Tglmbfrm.BitBtn1Click(Sender: TObject);
begin
    If ListBox1.Items.IndexOf(edit3.Text)<>-1 then
      showmessage('')
      else If ListBox4.Items.IndexOf(edit4.Text)<>-1 then
       showmessage('!')  
        else if application.MessageBox('','提示',mb_okcancel+mb_iconquestion)=id_ok then
  begin  endend;
我想在当3个IF条件不满足时都把EDIT1里的内容清空,该怎么写

解决方案 »

  1.   

    else
       edit1.text := '';
      

  2.   

    if ( ListBox1.Items.IndexOf(Edit3.Text)=-1) and (  ListBox4.Items.IndexOf(edit4.Text)=-1 ) then
      begin
           if application.MessageBox('提示','提示',mb_okcancel+mb_iconquestion)<>id_ok then
           begin
              edit1.Clear;
           end;  end;
      

  3.   

    If ListBox1.Items.IndexOf(edit3.Text)<>-1 then
          showmessage('')
          else 
    begin
      edit1.Clear;
      If ListBox4.Items.IndexOf(edit4.Text)<>-1 then
          showmessage('!')  
            else 
    begin
    edit1.Clear;
    if application.MessageBox('','提示',mb_okcancel+mb_iconquestion)=id_ok then
      begin  end
    else edit1.Clear;
    end;
    end;