发布网友 发布时间:2022-04-23 16:45
共1个回答
热心网友 时间:2022-07-13 03:19
与你分享我的方法在WINCC中创建全局C脚本函数实现POPUP弹出窗口方法:1、在全局脚本编辑器中编写C项目函数:voidOpenPopup(char*WindowName,char*CaptionText){#defineApcinBaseScreenName"inBaseScreenName"char*lpszBasePictureName;lpszBasePictureName=GetTagChar(ApcinBaseScreenName);SetVisible(lpszBasePictureName,"Popup",FALSE);SetLeft(lpszBasePictureName,"Popup",200);SetTop(lpszBasePictureName,"Popup",200);SetPictureName(lpszBasePictureName,"Popup",WindowName);SetPropChar(lpszBasePictureName,"Popup","CaptionText",CaptionText);SetVisible(lpszBasePictureName,"Popup",TRUE);}2、在你的画面在中放一个画面窗口取名为“Popup”尺寸大小随意;3、新建一个画面建立你的子窗口;4、回到原来画面在你要弹出子窗口的对象的单击事件中调用上面的函数:voidOpenPopup(char*WindowName,char*CaptionText),括号内参数:WindowName为你的子窗口名称,CaptionText为子窗口标题。