#include "apdefap.h"
void MouseDown(char* lpszPictureName, char* lpszObjectName , short Button, short Shift, long x, long y)
{
#pragma option(mbcs)
// WINCC:TAGNAME_SECTION_START
// syntax: #define TagNameInAction "DMTagName"
// next TagID : 1
// WINCC:TAGNAME_SECTION_END
// WINCC:PICNAME_SECTION_START
// syntax: #define PicNameInAction "PictureName"
// next PicID : 1
// WINCC:PICNAME_SECTION_END
long a,b;
a=GetLeft(lpszPictureName, "GYBBPQ1")+30;
b=GetTop(lpszPictureName, "GYBBPQ1")-20;
SetTagPrefix(lpszPictureName,"WINDOW2","#4高压泵频率."); //Return-Type: BOOL
SetPictureName(lpszPictureName,"WINDOW2","PLKZ-RO2.Pdl"); //Return-Type: BOOL
SetPropWord(lpszPictureName,"WINDOW2","Top",b); //Return-Type: BOOL
SetPropWord(lpszPictureName,"WINDOW2","Left",a);
//SetTagSDWord("XP",a); //Return-Type: BOOL
//SetTagSDWord("YP",b);
SetVisible(lpszPictureName,"WINDOW2",1); //Return-Type: BOOL
图片说明:
最佳答案
long a,b; //定义两个长整型数据变量
a=GetLeft(lpszPictureName, "GYBBPQ1")+30; //获得GYBBPQ1画面X轴位置,再加30
b=GetTop(lpszPictureName, "GYBBPQ1")-20; //获得GYBBPQ1画面Y轴位置,再减20
SetTagPrefix(lpszPictureName,"WINDOW2","#4高压泵频率."); //画面窗口"WINDOW2"中的变量都加前缀名称"#4高压泵频率." //Return-Type: BOOL
SetPictureName(lpszPictureName,"WINDOW2","PLKZ-RO2.Pdl"); //画面窗口"WINDOW2"指向画面"PLKZ-RO2.Pdl" //Return-Type: BOOL
SetPropWord(lpszPictureName,"WINDOW2","Top",b);//设置画面窗口"WINDOW2"的Y轴的位置为变量b //Return-Type: BOOL
SetPropWord(lpszPictureName,"WINDOW2","Left",a);//设置画面窗口"WINDOW2"的X轴的位置为变量a
//SetTagSDWord("XP",a); //Return-Type: BOOL
//SetTagSDWord("YP",b);
SetVisible(lpszPictureName,"WINDOW2",1); //设置"WINDOW2"画面可见 //Return-Type: BOOL
提问者对于答案的评价:
我想问一下怎么入门,有什么学习资料吗?
原创文章,作者:more0621,如若转载,请注明出处:https://www.zhaoplc.com/plc129965.html