(转载)delphi checklistbox用法
delphi checklistbox用法
在Delphi中checklistbox中高亮选中(不论是否Checked)能够进行操作么?删除,上下移动等等
删除:CheckListBox.DeleteSelected;
上下移: CheckListBox.Items.Move
删除用
CheckListBox1.Items.Delete(Index);
上下移动用
CheckListBox1.Items.Move(CurrentIndex,NewIndex);
//在项目中添加字符串(子项目的最后一位接着添加)
CheckListBox1.Items.Add(edit1.Text);
//全选 高亮选中Selected
CheckListBox1.MultiSelect := True;
CheckListBox1.SelectAll;
//全选 Checked All
procedure TForm1.Button11Click(Sender: TObject);
var i :integer;
begin
for i := 0 to CheckListBox1.Items.Count - 1 do
begin
CheckListBox1.Checked[i] := True;//反选设置为False
end;
end;
//让第n行被高亮选中
CheckListBox1.Selected[1]:=true;//第2行
//取消高亮选中
CheckListBox1.ClearSelection;
//第3行的项目灰色不可用
CheckListBox1.ItemEnabled[2] := False;//True可用
//删除高亮选中的项目,(只管高亮选中就会被删除,和checked是否无关)
CheckListBox1.DeleteSelected;//删除选中项目,即使该给项目 没勾上也会被删除
//删除已勾选的中项目
procedure TForm1.Button5Click(Sender: TObject);
var i : integer;
begin
for i := CheckListBox1.Items.Count-1 downto 0 do //从后面往前面删
begin
if CheckListBox1.Checked[i] then
begin
CheckListBox1.Items.Delete(i);
end;
end;
end;
//清空项目
CheckListBox1.Items.Clear;
//将CheckListBox1的全部添加到CheckListBox2的Items中
procedure TForm1.Button1Click(Sender: TObject);
var
i:Integer;
begin
CheckListBox2.Items.Clear;
for i := CheckListBox1.Items.Count - 1 downto 0 do
begin
CheckListBox2.Items.Add(CheckListBox1.Items[i]);
end;
end;
(转载)delphi checklistbox用法的更多相关文章
- delphi checklistbox用法
在Delphi中checklistbox中高亮选中(不论是否Checked)能够进行操作么?删除,上下移动等等 删除:CheckListBox.DeleteSelected; 上下移: CheckLi ...
- Delphi TStringHelper用法详解
Delphi TStringHelper用法详解 (2013-08-27 22:45:42) 转载▼ 标签: delphi_xe5 it 分类: Delphi Delphi XE4的TStringHe ...
- delphi TStringList 用法详解
转自: http://blog.163.com/you888@188/blog/static/67239619201472365642633/ delphi TStringList 用法详解 2014 ...
- delphi webbrowser用法集锦
delphi webbrowser用法集锦 (2012-05-13 08:29:00) 标签: it 分类: 软件_Software WebBrowser1.GoHome; //到浏览器默认主页 We ...
- Delphi - StringReplace用法
StringReplace用法 在开发过程中,有时候我们需要对字符串进行替换操作,屏蔽或者和谐某些字符,可使用Delphi自带的函数StringReplace函数. 通过代码进行说明: //函数原型 ...
- [转载] C++ typedef 用法详解
typedef的语法描述 在现实生活中,信息的概念可能是长度,数量和面积等.在C语言中,信息被抽象为int.float和 double等基本数据类型.从基本数据类型名称上,不能够看出其所代表的物理属性 ...
- [转载]typedef常见用法
注:本文系转载,并修改了一些错误. typedef常见用法 1.常规变量类型定义 例如:typedef unsigned char uchar描述:uchar等价于unsigned char类型定义 ...
- 转载 AutoFac常见用法总结
第二节:框架前期准备篇之AutoFac常见用法总结 一. 说在前面的话 凡是大约工作在两年以上的朋友们,或多或少都会接触到一些框架搭建方面的知识,只要一谈到框架搭建这个问题或者最佳用法这个问题,势 ...
- delphi json用法
用法:uses Superobject, Sperjsondelphi里有json单元. procedure TForm2.SuperObjectClick(Sender: TObject); var ...
随机推荐
- android118 上拉下拉刷新列表listView实现
MainActivity.java package com.heima52.pullrefresh; import java.util.ArrayList; import com.heima52.pu ...
- c语言实例
#include <stdio.h> int main() { ; ; i=max(j,k); printf("i=%d\n",i); ; } int max(int ...
- 学通javaweb 24堂课 学习笔记
17.01:简单配置控制器 1.一个controller protected ModelAndView handleRequestInternal(HttpServletRequest request ...
- Android实现资料收藏
1,调web浏览器 Uri myBlogUri = Uri.parse("http://xxxxx.com"); returnIt = new Intent(Intent.ACTI ...
- Enable HTTPS in Spring Boot
Spring-boot-enable-ssl Enable HTTPS in Spring Boot APRIL 14, 2015DRISS AMRI This weekend I answered ...
- Fortify对移动应用安全的支持
Fortify对移动应用安全的支持http://www.docin.com/p-768827684.html
- C#一些小知识点
1. 在Load时候由代码来做控件PictureBox,并且用代码将图片加载进去: private void Form2_Load(object sender, EventArgs e) { Dire ...
- CentOS 7 gedit编辑器中文乱码解决方法
无需root登陆 打开终端输入如下命令: gsettings set org.gnome.gedit.preferences.encodings auto-detected "['GB180 ...
- 【转】BUG敏感度的培养
在我们刚踏入软件测试行业时,不管你是专业的.非专业的,培训出来的还是未培训的.刚进公司时你看着身边的同时报的Bug很多并且大都是严重程度高,自己也很想提高一下,想要提高自己的bug敏感度,建议从下面几 ...
- PHP输入流php://input介绍
在使用xml-rpc的时候,server端获取client数据,主要是通过php输入流input,而不是$_POST数组.所以,这里主要探讨php输入流php://input 对一php://inpu ...