★★★如何设置使ListView具有这样的风格★★★

xxiao07 2004-08-02 10:09:44
见图:http://bbs.263.net/forumData/84/2406776_1.jpg

注意:每行还有CheckBox
...全文
257 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
cso 2004-08-03
  • 打赏
  • 举报
回复
6.0版本的可以直接设置ListView的属性ListView1.Checkboxes = True
5.0版本的要用代码:sendmessage的api函数发一个好象是Const LVS_EX_CHECKBOXES = &H4的消息
SafeF8 2004-08-02
  • 打赏
  • 举报
回复
忘了这个ListView1.View = lvwReport
northwolves 2004-08-02
  • 打赏
  • 举报
回复
Option Explicit

Private Sub Form_Load()
Dim i As Integer
With ListView1
.View = lvwReport
.GridLines = True
.Checkboxes = True
.ColumnHeaders.Add , , "A"
.ColumnHeaders.Add , , "A*A"
.ColumnHeaders.Add , , "A*A*A"
For i = 1 To 10
.ListItems.Add i, , i
.ListItems(i).SubItems(1) = i ^ 2
.ListItems(i).SubItems(2) = i ^ 3
Next
End With
End Sub
SafeF8 2004-08-02
  • 打赏
  • 举报
回复
设置ListView的属性ListView1.Checkboxes = True, ListView1.GridLines =True
最好加上ListView1.FullRowSelect =True 这样就可以整行选择.
在安卓中要改变AlertDialog的外观是非常不容易的事情,即便是HoneyComb之后增加了android:singleChoiceItemLayout属性。AlertDialogPro可以让事情变得简单,它包含了AlertDialog的所有功能,同时还具有灵活的自定义功能,代码中还自带了已经定义好的holo和material 两种风格的对话框。项目地址:https://github.com/fengdai/AlertDialogPro 效果图:如何使用1.创建AlertDialogPro除了将AlertDialog.Builder替换成AlertDialogPro.Builder之外其他的和AlertDialog没有区别。AlertDialogPro.Builder builder = new AlertDialogPro.Builder(getContext()); builder.setTitle("Title").        setIcon(R.drawable.ic_launcher).        setMessage("Message").        setNeutralButton("Neutral", null).        setPositiveButton("OK", null).        setNegativeButton("Cancel", null).        show();2.holo风格的dialog包含两种holo:Theme.AlertDialogPro.Holo和Theme.AlertDialogPro.Holo.Light只需在style文件中加入alertDialogProTheme属性:<style name="AppTheme" parent="AppBaseTheme">   ...   <!-- Use Holo dark theme as global theme of this app -->   @style/Theme.AlertDialogPro.Holo </style>或者是在代码中创建dialog的时候设置:AlertDialogPro.Builder builder = new AlertDialogPro.Builder(getContext(), R.style.Theme_AlertDialogPro_Holo_Light);3.Material风格的dialog包含Theme.AlertDialogPro.Material 和Theme.AlertDialogPro.Material.Light 两种风格,使用方法和上面的holo差不多,但是需要AppCompat-v21的支持。4.自定义如果其中某一种风格符合你的绝大部分需求,但是需要做些改动,你可以设置以下属性:<!-- Minimum height of title panel--> <!-- The text appearance for the dialog's message text --> <!-- Minimum height of ListView's items --> <!-- The text color for ListView's items --> <!-- The text appearance for normal ListView's items --> <!-- The text appearance for "multi-choice" ListView's items --> <!-- The text appearance for "single-choice" ListView's items --> <!-- Divider for the ListView --> <!-- Selector in a ListView --> <!-- Style for button bars --> <!-- Style for buttons within button bars --> <!-- Style for the "positive" buttons within button bars --> <!-- Style for the "negative" buttons within button bars --> <!-- Style for the "neutral" buttons within button bars --> 你甚至可以设置alertdialog的整个布局,如果你需要的是高度自定义的dialog,这是非常重要的。<style name="AlertDialogPro.Material">   <!-- As HoneyComb's android:layout.        Specify your AlertDialogPro's layout -->   @layout/adp_alert_dialog_material   <!-- As HoneyComb's android:listLayout.        Specify your AlertDialogPro's ListView layout. -->   @layout/adp_select_dialog_material   <!-- As HoneyComb's android:listItemLayout.        Specify your AlertDialogPro's list item layout. -->   @layout/adp_select_dialog_item_material   <!-- As HoneyComb's android:multiChoiceItemLayout.        Specify your AlertDialogPro's multi choice list item layout. -->   @layout/adp_select_dialog_multichoice_material   <!-- As HoneyComb's android:singleChoiceItemLayout.        Specify your AlertDialogPro's single choice list item layout. -->   @layout/adp_select_dialog_singlechoice_material </style>使用上面自定义的alertdialog@style/AlertDialogPro.Material

1,451

社区成员

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

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