wincc按钮二次确认
点击确认按钮,如何实现弹出窗口二次确认。 最佳答案
把下面的代码复制一下,在你的按钮按左键,使用c语言进行组态动作,将“zcf-start-hd”更换为你的变量即可,#include”apdefap.h”
voidonlbuttondown(char*lpszpicturename,char*lpszobjectname,char*lpszpropertyname,uintnflags,intx,inty) { intj;
dworddwhelp1,dwhelp2;
j=messagebox(null,”您确定要启动吗?”,”注意!”,mb_okcancel|mb_iconexclamation|mb_setforeground|mb_systemmodal); if(j==1) {
settagbit(“zcf-start-hd”,1); }
//wincc:tagname_section_start
//syntax:#definetagnameinaction”dmtagname” //nexttagid:1
//wincc:tagname_section_end //wincc:picname_section_start
//syntax:#definepicnameinaction”picturename” //nextpicid:1
//wincc:picname_section_end }
然后在释放左键中组态c语言,复制下列代码,将“zcf-start-hd”更换为你要改变的变量即可 #include”apdefap.h”
voidonlbuttonup(char*lpszpicturename,char*lpszobjectname,char*lpszpropertyname,uintnflags,intx,inty) {
settagbit(“zcf-start-hd”,0);//wincc:tagname_section_start //syntax:#definetagnameinaction”dmtagname” //nexttagid:1
//wincc:tagname_section_end //wincc:picname_section_start
//syntax:#definepicnameinaction”picturename” //nextpicid:1
//wincc:picname_section_end }