if (edit1.Text='5')and(edit2.Text='5') then
   form1.Visible:=false
    else
   for i := 0 to groupbox1.ControlCount-1 do
  if groupbox1.Controls[i] is Tedit then
  Tedit(groupbox1.Controls[i]).Clear;
  showmessage('请核对用户名或密码');  if form1.Visible=false then
    form2.ShowModal; 
我输入正确 还弹出来‘请核对用户名或密码’ 请问吧这句showmes放在哪里合适 应该只有错误的时候才弹出来

解决方案 »

  1.   

    if (edit1.Text='5')and(edit2.Text='5') then 
      form1.Visible:=false 
        else 
      for i := 0 to groupbox1.ControlCount-1 do begin
      if groupbox1.Controls[i] is Tedit then 
      Tedit(groupbox1.Controls[i]).Clear; 
      showmessage('请核对用户名或密码'); end;
      

  2.   

      if groupbox1.Controls[i] is Tedit then 
       begin
        Tedit(groupbox1.Controls[i]).Clear; 
        showmessage('请核对用户名或密码'); 
      end;
      

  3.   

    if (edit1.Text='5')and(edit2.Text='5') then 
      form1.Visible:=false 
        else begin
      for i := 0 to groupbox1.ControlCount-1 do
      if groupbox1.Controls[i] is Tedit then 
      Tedit(groupbox1.Controls[i]).Clear; 
      showmessage('请核对用户名或密码'); end; 
      

  4.   

     if groupbox1.Controls[i] is Tedit then 
    begin
      Tedit(groupbox1.Controls[i]).Clear; 
      showmessage('请核对用户名或密码'); end;
      

  5.   

    if (edit1.Text='5')and(edit2.Text='5') then 
      form1.Visible:=false 
        else begin 
      for i := 0 to groupbox1.ControlCount-1 do 
      if groupbox1.Controls[i] is Tedit then 
      Tedit(groupbox1.Controls[i]).Clear; 
      showmessage('请核对用户名或密码'); end; 
      

  6.   

    把鼠标放在"if (edit1.Text='5')and(edit2.Text='5') then "一行。
    按F4运行,运行到鼠标所在行后,按F8一步步看到了哪里。
    然后,类似问题,都是可以解决的。
    @_@
      

  7.   

    O_O _の囧の_O_O国庆快乐!!!
      

  8.   


    if (edit1.Text='5')and(edit2.Text='5') then 
      form1.Visible:=false 
    else 
      for i := 0 to groupbox1.ControlCount-1 do
        if groupbox1.Controls[i] is Tedit then
        begin 
          Tedit(groupbox1.Controls[i]).Clear; 
          showmessage('请核对用户名或密码'); 
        end;
    if form1.Visible=false then 
      form2.ShowModal; 
      

  9.   

    我咋感觉是少了一对begin和end
      

  10.   

    呵呵,楼主,Pascal是需要加上Begin...End;的.
      

  11.   

    if trim(edit1.Text='5')and trim(edit2.Text='5') then 要养成这种习惯!