string ls_CurObj,ls_CurCol //當前物件,當前列
ls_CurObj = String(dwoname)
if dw_1.Describe(ls_CurObj + ".Band") = "header" then
ls_CurCol = Left(ls_CurObj,Len(ls_CurObj) - 2)
if dw_1.Describe(ls_CurObj + ".Border") = '5' then
dw_1.Modify(ls_CurObj + ".Border = 6")
dw_1.SetSort(ls_CurCol + " A" )
else
dw_1.Modify(ls_CurObj + ".Border = 5")
dw_1.SetSort(ls_CurCol + " D" )
end if
dw_1.Sort()
// return 1 //避免反色顯示
end if
uj5u.com熱心網友回復:
string ls_CurObj,ls_CurCol //當前物件,當前列ls_CurObj = String(dwoname)
if dw_1.Describe(ls_CurObj + ".Band") = "header" then //如果點擊的是表頭
ls_CurCol = Left(ls_CurObj,Len(ls_CurObj) - 2) //得到列名,一般表頭名稱是列名后面加'_t'
if dw_1.Describe(ls_CurObj + ".Border") = '5' then //border=5 - 3D Lowered border =6 - 3D Raised,根據border的型別判斷升序還是降序
dw_1.Modify(ls_CurObj + ".Border = 6")
dw_1.SetSort(ls_CurCol + " A" )
else
dw_1.Modify(ls_CurObj + ".Border = 5")
dw_1.SetSort(ls_CurCol + " D" )
end if
dw_1.Sort()
// return 1 //避免反色顯示
end if
uj5u.com熱心網友回復:
給你一段更完善的點擊排序并加圖示的示例吧string ls_AddIcon
string ls_CurObj
string ls_CurCol
integer li_IconPos
ls_CurObj = String(dwo.Name)
// 檢驗是否標題欄
If Row = 0 AND This.Describe(ls_CurObj + ".Text") <> "!" AND &
This.Describe(ls_CurObj + ".Band") = "header" Then
//取當前列列名
ls_CurCol = Left(ls_CurObj, Len(ls_CurObj) - 2)
// 若點擊列與上次不同時的處理
IF is_OrderCol <> ls_CurCol THEN
//洗掉上次所建文本
This.Modify("DESTROY t_sort_" + is_OrderCol)
is_OrderCol = ls_CurCol
is_SortType = "A" // 升序
//加載圖示的位置:滑鼠所點擊標題的右邊
li_IconPos = Integer(This.Describe(ls_CurObj + ".X")) + &
Integer(This.Describe(ls_CurObj + ".Width")) - 66
//創建透明文本語法
ls_AddIcon = &
'create text(band=foreground alignment="2" text="▲"' + &
' border="0" color="' + String(il_icon_color) + '" ' + &
' x="' + String(li_IconPos) + '" y="12" height="56" width="55"' + &
' border="0" name=t_sort_' + is_OrderCol + ' visible="1"' + &
' font.face="Arial" font.height="-10" font.weight="400"' + &
' font.family="2" font.pitch="2" font.charset="0"' + &
' background.mode="1")'
//創建透明文本,顯示排序圖示▲
This.Modify(ls_AddIcon)
This.SetSort(is_OrderCol + " " + is_SortType)
This.Sort()
Else //若點擊列與上次相同,反序排列
If is_SortType = "A" Then
is_SortType = "D"
This.Modify('t_sort_' + is_OrderCol + ".text = '▼'")
Else
is_SortType = "A"
This.Modify('t_sort_' + is_OrderCol + ".text = '▲'")
End If
This.SetSort(is_OrderCol + " " + is_SortType)
This.Sort()
End If
//點擊標題時,不讓整列反黑顯示
return 1
End If
uj5u.com熱心網友回復:
up 2樓.uj5u.com熱心網友回復:
多謝二樓三樓的回復 非常感謝uj5u.com熱心網友回復:
學習了uj5u.com熱心網友回復:
頂2樓!!!uj5u.com熱心網友回復:
學習...........uj5u.com熱心網友回復:
頂,
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/87800.html
標籤:腳本語言
下一篇:PB打包問題
