如何同时滚动两个数据窗口?

时间:2019-03-18 08:55:03

标签: powerbuilder

我有两个具有相同列数的数据窗口,它是Freeform。我已经(垂直)一个接一个地排列了列。     如何在Powerbuilder 10.5中同时滚动两个数据窗口?

3 个答案:

答案 0 :(得分:1)

将此代码放入dw_1 ScrollVertical事件中以同步dw_2。

dw_2.Object.datawindow.verticalscrollposition = scrollpos

答案 1 :(得分:0)

您可能要在第二个数据窗口上使用ScrollToRow方法。但是,由于您已将各列排列为垂直的长行,因此尚不清楚这是否适合您。

数据窗口控件上还有一个SetColumn方法,但这不会“滚动”到该列以使其可见。

Datawindow控件还具有ScrollVertical和ScrollHorizo​​ntal事件,您也可以使用它们。

在PowerBuilder帮助中查找这些方法以获取更多信息。

答案 2 :(得分:0)

If there is a link between the data of the 2 datawindows (there must be one, otherwaise, I do not see your point), you might consider to create a single datawindow. Instead of

select col1A, col2A,...colnA from tableA
select col1B, col2B,...colnB from tableB

You would have

select col1A, col1B, col2a, col2B,.... from tableA, tableB where ...

Some caveats:

  • As indicated, you need a link between the 2 tables.
  • Update might be trickier: you can only define in the datawindow painter one table to be updated. Programmatically, it is possible to change that, however.