请问怎么写这样的一段代码:
  在点一个按钮触发这个按钮的事件之前先给出提示询问是不是要触发这个事件我是这样写的
if application.MessageBox('确定添加?','提示',mb_okcancel)=idok then
后面就是按钮的事件了
可是不管我点确定或者取消,都会发生以后的事件
请问如何解决。谢谢

解决方案 »

  1.   

    还有一个问题就是比如
     if edit1.text='' then
    ....
    请问如何将edit2.text也加入进去?
    是不是 if edit1.text and edit2.text=''????
    我试过了没用
    请问如何解决
      

  2.   

    if (edit1.text='') and (edit2.text='') then begin
    ..
    end;
      

  3.   

    if application.MessageBox('确定添加?','提示',mb_okcancel)=idcancel then
      exit;
    //following codes will be done when u click ok button in the message box
    ...
      

  4.   

    或者
    if application.MessageBox('确定添加?','提示',mb_okcancel)=idcancel then
      abort;