在 Canalyzer 上使用 Capl 脚本以编程方式设置控件位置 属性

Set control Location property programatically with Capl script on Canalyzer

我使用 Vector Panel Designer 设计了一个面板,因此我可以在 CANAlyzer 中显示它。

现在我正在尝试根据 CAN 信号的值设置图片框控件的位置。

我尝试了几种选择但没有成功。我的面板名为 "ObjectsPanel",图片框控件名为 "Point1"。这些是我测试过的一些选项:

on start{
  setControlProperty("ObjectsPanel","Point1","X","150");
  setControlProperty("ObjectsPanel","Point1","X",150);
  setControlProperty("ObjectsPanel","Point1","Location","150, 200");
  setControlProperty("ObjectsPanel","Point1","Location.X",150);
}

似乎 SetControlProperty 只能以编程方式更改控件的以下属性:BackColor 和 ForeColor。

引自 CANalyzer 文档:

The CAPL SetControlProperty routine is now only permissible for the BackColor and ForeColor properties of controls created with the Panel Designer. Please use the SetControlBackColor and SetControlForeColor routines in such cases. You can also use the following CAPL functions to modify and manage controls: SetMediaFile, SetPictureBoxImage, SetClockControlTime, ClockControlStart, ClockControlStop, ClockControlReset.