如何修改modify并提交了的行的背景颜色,在datawindow中?(在线)

justone 2002-05-27 01:27:24
同题
...全文
81 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
WorldMobile 2002-05-27
  • 打赏
  • 举报
回复
dw_main.modify("detail.color = if(not isRowModified(), rgb(255, 255, 255), rgb(58, 110, 165))")
海洋‘s 2002-05-27
  • 打赏
  • 举报
回复
可以参考啊...........
if(getrow()=currentrow(),rgb(0,0,255),rgb(0,0,128))
if(getrow()=currentrow(),rgb(0,255,255),rgb(255,255,255))
blackcorbie 2002-05-27
  • 打赏
  • 举报
回复
你可以这样:
dw_1.selectrow(0,false)
dw_1.selectrow(row,true)

你要是改变整个数据窗口的背景颜色,就在创建数据窗口的时候,选择属性即可!
海洋‘s 2002-05-27
  • 打赏
  • 举报
回复
string mod_string, err

long color1, color2, color3, default_color

err = dw_emp.Modify("salary.Background.Mode=0")

IF err <> "" THEN
MessageBox("Status", &
"Change to Background Mode Failed " + err)
RETURN

END IF

/* Pseudocode for mod_string:

If salary less than 10000, set the background to red.

If salary greater than or equal to 10000 but less than 20000, set the background to blue.

If salary greater than or equal to 20000 but less than 30000, set the background color to green.

Otherwise, set the background color to white, which is also the default.

*/

color1 = 255 //red

color2 = 16711680 //blue

color3 = 65280 //green

default_color = 16777215//white

mod_string = &
"salary.Background.Color = '" &
+ String(default_color) &
+ "~tIf(salary < 10000," &
+ String(color1) &
+ ",If(salary < 20000," &
+ String(color2) &
+ ",If(salary < 30000," &
+ String(color3) &
+ "," &
+ String(default_color) &
+ ")))'"

err = dw_emp.Modify(mod_string)

IF err <> "" THEN
MessageBox("Status", &
"Change to Background Color Failed " + err)
RETURN

END IF

611

社区成员

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

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