在點擊標題欄排序的時候﹐如何給標題欄顯示一個三角形

shinesky 2003-10-16 12:32:33
看到過一個PB程序﹐在點擊標題欄排序的時候﹐在標題欄會出現一個三角形﹐并且能根據升降序而改變形狀﹐各位﹐有誰知道是怎么實現的嗎﹐告訴一下﹐不勝感激﹗
...全文
63 6 打赏 收藏 转发到动态 举报
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
jackzhang168 2003-10-17
  • 打赏
  • 举报
回复
string ls_AddPict, ls_CurObj, ls_Picture, ls_CurCol
integer li_PictPos

ls_CurObj = String(dwo.Name)
If Row = 0 AND This.Describe(ls_CurObj + ".Text") <> "!" AND This.Describe(ls_CurObj + ".Band") = "header" Then // Valid header object?
ls_CurCol = Left(ls_CurObj,Len(ls_CurObj) - 2)
If is_OrderCol <> ls_CurCol Then // Different Column
This.Modify("DESTROY p_" + is_OrderCol)
is_OrderCol = Left(ls_CurObj,Len(ls_CurObj) - 2)
ls_Picture = "UP.BMP"
is_SortType = "A" // Ascending sort
li_PictPos = Integer(This.Describe(ls_CurObj + ".X"))+ (Integer(This.Describe(ls_CurObj + ".Width")) - 70)
ls_AddPict ='create bitmap(band=foreground filename="' + ls_Picture + '" ' + &
' x="' + String(li_PictPos) + "~tInteger(describe('" + is_OrderCol + &
".X')) + (Integer(describe('" + is_OrderCol + ".Width'))" + ' - 70)" y="24" ' + &
' height="33" width="51" border="0" name=p_' + is_OrderCol + ' visible="1")'
This.Modify(ls_AddPict)
This.SetSort(is_OrderCol + " " + is_SortType)
This.Sort()
Else
If is_SortType = "A" Then
ls_Picture = "DOWN.BMP"
is_SortType = "D"
Else
ls_Picture = "UP.BMP"
is_SortType = "A"
End If
This.Modify('p_' + is_OrderCol + '.filename = "' + ls_Picture + '"')
This.SetSort(is_OrderCol + " " + is_SortType)
This.Sort()
End If
End If
shinesky 2003-10-17
  • 打赏
  • 举报
回复
我的e_mail是kk14154@163.com,先謝了
xuyi1979 2003-10-17
  • 打赏
  • 举报
回复
用图片不是好方法,因为图片的颜色是固定的,可能会导致三角颜色和标题颜色不符,比较难看,但我想不出怎么做到windows那样的好方法。
纳米茶 2003-10-16
  • 打赏
  • 举报
回复
做一个datawindow的基类。制作两个三角的图形文件。

在基类的click事件中写入创建bmp图片的代码即可

你的email,给你一个例子
playyuer 2003-10-16
  • 打赏
  • 举报
回复
caption = "↓"
flyerlxg 2003-10-16
  • 打赏
  • 举报
回复
自定义对象去实现吧,我这里有一个例子,其将数据提进数据窗口,然后点对应的标题栏就可以实现排序的功能,同时有一个三角形标示。给我电邮吧,我email给您,我的email是system@szonline.net

1,075

社区成员

发帖
与我相关
我的任务
社区描述
PowerBuilder 相关问题讨论
社区管理员
  • 基础类社区
  • WorldMobile
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

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