为什么DATAWINDOW的CLICK事件中取的是上一个状态

whx_green 2002-12-19 01:10:05
在datawindow的click事件中取鼠标所点的行数,但每次取的是上一次点击的行数。
...全文
85 7 打赏 收藏 转发到动态 举报
写回复
用AI写文章
7 条回复
切换为时间正序
请发表友善的回复…
发表回复
whx_green 2002-12-19
  • 打赏
  • 举报
回复
谢谢xuebuctxy(xuemin)!!!
andyzq 2002-12-19
  • 打赏
  • 举报
回复
直接用clicked中的row参数,row的值就是当前点中的行号
xuebuctxy 2002-12-19
  • 打赏
  • 举报
回复
click事件的参数里就有行号,还取什么啊!
whx_green 2002-12-19
  • 打赏
  • 举报
回复
就是这样的,不信,你试一把。
balloonman2002 2002-12-19
  • 打赏
  • 举报
回复
不会吧,,,

Description

Occurs when the user clicks anywhere in a DataWindow control.

Event ID
Event ID Objects
pbm_dwnlbuttonclk DataWindow
Arguments
Argument Description
xpos Integer by value (the distance of the pointer from the left side of the DataWindow's workspace)
ypos Integer by value (the distance of the pointer from the top of the DataWindow's workspace)
row Long by value (the number of the row the user clicked) If the user doesn't click on a row, the value of the row argument is 0. For example, row is 0 when the user clicks outside the data area, in text or spaces between rows, or in the header, summary, or footer area
dwo DWObject by value (a reference to the object within the DataWindow under the pointer when the user clicked)
Return value
Long. Return code choices (specify in a RETURN statement):

0 Continue processing
1 Prevent the focus from changing

Usage

The DataWindow Clicked event occurs when the mouse button is pressed down.

The xpos and ypos arguments provide the same values the functions PointerX and PointerY return when you call them for the DataWindow control.

The dwo argument provides easy access to the object the user clicks. You don't need to know the coordinates of elements within the DataWindow to program object-specific responses to the user's clicks.

For example, you can prevent editing of a column and use the Clicked script to set data or properties for the column and row the user clicks.

For graphs, the ObjectAtPointer function provides similar information about objects within the graph object.

A click can also trigger RowFocusChanged and ItemFocusChanged events.

A double-click triggers a Clicked event, then a DoubleClicked event.


This code highlights the row the user clicked.

This.SelectRow(row, TRUE)


whx_green 2002-12-19
  • 打赏
  • 举报
回复
long ll_row
ll_row=dw_result.getrow()
messagebox("1",ll_row)
这样,取的是上一次点击的行数,应该怎样取呢?
andyzq 2002-12-19
  • 打赏
  • 举报
回复
加上accepttext()试试

611

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder DataWindow
社区管理员
  • DataWindow社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧