资源简介
本方法和用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
相关资源
- OA系统源码
- 超级在线考试系统
- netErpCore_V3.6 一套完整拿来即用的ERP开
- Iocomp.Components.v4.02.SP2
- [免费PDF]敏捷开发的艺术 中文高清完
- 最简洁代码实现Listview多选
- .net版微信编辑器
- Unity机械结构仿真
-
NET+fr
amework+4.0+常用类库参考手册( - 打包工具SetupFactory7.0.1破解汉化版含教
- Supermap地图着色
- VCSharp2013从入门到精通中英文版/Micr
- .netMVC框架微信公众号支付
- MapDownloader
- 语音卡开发真实案例
- aceadmin1.4已改造treeview多选完整版
- NPOI2.3资源包
- .NET文件加密及其播放器
- .net版本单点登录与权限管理web api)可
- LMI 3D相机采图
- 仿通达OA完整源码
- .NET SAP NCO4.0
- 基于CSkin.dll的程序
- WindowsFormsApp3.zip
- 学生管理系统学生管理系统
- 仿淘宝图片空间自己做的一个图片管
- SignalR完整源码
- OPENCV车道检测与车辆识别
- 电脑网站支付快捷下单-微信
- 电脑网站支付快捷下单-支付宝
评论
共有 条评论