资源简介
本方法和用checkbox, listbox等控件和事件拼凑出来的不同,本方法是一个集成的独立控件,基本实现了控件的顺滑度,下拉框可悬浮等效果,可以认为是comboBox的升级版,使用方便,仅需引用编译好的DLL,直接在toolBox拖拽出控件即可。
代码片段和文件信息
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Text;
using System.Windows.Forms;
using System.Reflection;
using System.Collections.objectModel;
using System.Collections.Specialized;
namespace PresentationControls
{
///
/// Martin Lottering : 2007-10-27
/// --------------------------------
/// This is a usefull control in Filters. Allows you to save space and can replace a Grouped Box of CheckBoxes.
/// Currently used on the TasksFilter for TaskStatusses which means the user can select which Statusses to include
/// in the “Search“.
/// This control does not implement a CheckBoxListBox instead it adds a wrapper for the normal ComboBox and Items.
/// See the CheckBoxItems property.
/// ----------------
/// ALSO IMPORTANT: In Data Binding when setting the DataSource. The ValueMember must be a bool type property because it will
/// be binded to the Checked property of the displayed CheckBox. Also see the DisplayMemberSingleItem for more information.
/// ----------------
/// Extends the CodeProject PopupComboBox “Simple pop-up control“ “http://www.codeproject.com/cs/miscctrl/simplepopup.asp“
/// by Lukasz Swiatkowski.
///
public partial class CheckBoxComboBox : PopupComboBox
{
#region CONSTRUCTOR
public CheckBoxComboBox()
: base()
{
InitializeComponent();
_CheckBoxProperties = new CheckBoxProperties();
_CheckBoxProperties.PropertyChanged += new EventHandler(_CheckBoxProperties_PropertyChanged);
// Dumps the ListControl in a(nother) Container to ensure the ScrollBar on the ListControl does not
// Paint over the Size grip. Setting the Padding or Margin on the Popup or host control does
// not work as I expected. I don‘t think it can work that way.
CheckBoxComboBoxListControlContainer ContainerControl = new CheckBoxComboBoxListControlContainer();
_CheckBoxComboBoxListControl = new CheckBoxComboBoxListControl(this);
_CheckBoxComboBoxListControl.Items.CheckBoxCheckedChanged += new EventHandler(Items_CheckBoxCheckedChanged);
ContainerControl.Controls.Add(_CheckBoxComboBoxListControl);
// This padding spaces neatly on the left-hand side and allows space for the size grip at the bottom.
ContainerControl.Padding = new Padding(4 0 0 14);
// The ListControl FILLS the ListContainer.
_CheckBoxComboBoxListControl.Dock = Dockstyle.Fill;
// The DropDownControl used by the base class. Will be wrapped in a popup by the base class.
DropDownControl = ContainerControl;
// Must be set after the DropDownControl is set since the popup is recreated.
// NOTE: I made the dropDown protected so that i
- 上一篇:SVM源代码和测试图片
- 下一篇:磁链观测方案.pdf
相关资源
- WPF USB 网络 串口 通信软件
- B/S 网上订餐系统
- 教室管理系统.rar
- 小鸡快跑游戏.
-
分别适用于.NET fr
amework 2.0和4.0的E - 汽车租赁系统............................
- 一个扩展的CComboBox 下拉框 自绘 美化
- 德卡D8读写器关于读写感应卡的一些代
- halcon 测量助手
- 可编辑的CListctrl 支持CEDIT文本框,C
- 图片存储到数据库保存二进制文件并
- 用Socket写的简易FTP服务器和客户端
- 企业销售管理信息系统(全套)
- 串口操作类(justinio)
- 基于Petri网的工作流(完整的原创源代
- 选择题自动考试系统
- 多线程实例:桌面智能弹球小游戏
- 土地信息管理系统
- ServiceStack V3.9 全部dll
- PDF pdfview.ocx 无水印
- extjs editgrid combobox 回显
- 无需共享打印机实现远程打印功能小
- 真正的破解版PDFView4NET
- 网页调用ActiveX控件获取串口数据
- Luence的与盘古分词的使用软件
- Emgu.CV 打开视频与人脸检测
- 麦克纳姆轮程序.rar
- Unity3D 实战视频教程 保卫萝卜 2D 游戏
- net微信支付
- lucene.net+盘古分词多条件全文检索并匹
评论
共有 条评论