Foxtable(狐表)用户栏目专家坐堂 → [求助]listview标题行居中对齐


  共有1993人关注过本帖树形打印复制链接

主题:[求助]listview标题行居中对齐

帅哥哟,离线,有人找我吗?
有点甜
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:版主 帖子:85326 积分:427815 威望:0 精华:5 注册:2012/10/18 22:13:00
  发帖心情 Post By:2017/10/17 17:27:00 [显示全部帖子]

 可以绘制单元格 DrawViewCell

 

http://www.foxtable.com/webhelp/scr/2874.htm

 

 

e.DrawDefault = False '取消默认的绘制
Dim g As Graphics = e.Graphics
Dim sf As new StringFormat
Dim cs1() As String = {"国家","备注","宗教"}
Dim cs2() As String = {"语言"}
Dim cs3() As String = {"日期", "人口"}
If array.Indexof(cs1, e.Col.name) >= 0 Then
    sf.Alignment = StringAlignment.near
    sf.LineAlignment = StringAlignment.near
ElseIf array.Indexof(cs2, e.Col.name) >= 0 Then
    sf.Alignment = StringAlignment.Center
    sf.LineAlignment = StringAlignment.Center
ElseIf array.Indexof(cs3, e.Col.name) >= 0 Then
    sf.Alignment = StringAlignment.far
    sf.LineAlignment = StringAlignment.far
Else
    sf.Alignment = StringAlignment.near
    sf.LineAlignment = StringAlignment.near
End If

Dim fnt As New Font("宋体",9)
Dim msg As String = e.Row(e.Col.name)
g.DrawString(msg,fnt,Brushes.black,  new Rectangle(e.x, e.y, e.width, e.height), sf)


 回到顶部