Hi,
Can CheckBox be added into ListBox? If yes then how ?
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Dec 5, 2011, 11:19 AM
Try this...
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
private CheckedListBox chkListPossibleValues=new CheckedListBox();
public Form1()
{
InitializeComponent();
this.chkListPossibleValues = new System.Windows.Forms.CheckedListBox();
this.SuspendLayout();
this.chkListPossibleValues.Items.AddRange(new object[] {"One", "Two", "Three",
"Four", "Five","Six","Seven", "Eight", "Nine"});
this.chkListPossibleValues.Location = new System.Drawing.Point(8, 8);
this.chkListPossibleValues.Name = "chkListPossibleValues";
this.chkListPossibleValues.Size = new System.Drawing.Size(136, 184);
this.chkListPossibleValues.TabIndex = 0;
this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
this.ClientSize = new System.Drawing.Size(376, 205);
this.Controls.AddRange(new System.Windows.Forms.Control[] { this.chkListPossibleValues });
this.Name = "Form1";
this.Text = "List Boxes";
this.ResumeLayout(false);
}
}
}
Thanks
Alok PandeyPosted Dec 5, 2011, 11:22 PM
Sam HobbsPosted Dec 5, 2011, 1:37 PM