Python实现弹出提示框,有是/否/取消字样,不同按钮点击执行不同操作
如图:
效果:
源码:
#弹出提示框,提示是否取消,执行不同操作
import clr
clr.AddReference('mscorlib')
clr.AddReference('Kingdee.BOS')
clr.AddReference('Kingdee.BOS.Core')
from Kingdee.BOS.Core.DynamicForm import *
from Kingdee.BOS.Core.DynamicForm.PlugIn import *
from Kingdee.BOS.Core.DynamicForm.PlugIn.Args import *
from Kingdee.BOS.Util import *
def AfterBindData(e):
this.View.ShowMessage("是否继续?", MessageBoxOptions.YesNoCancel, lambda result:DoSth(result));
def DoSth(result):
if (result == MessageBoxResult.Yes):
this.Model.SetValue("F_PAEZ_Remarks", "点了是");
elif (result == MessageBoxResult.No):
this.Model.SetValue("F_PAEZ_Remarks", "点了否");
else:
this.Model.SetValue("F_PAEZ_Remarks", "点了取消");