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.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Satyapriya NayakRank #47 · 31.5K reputationPosted Dec 5, 2011, 6:19 AM EST
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
Sam HobbsRank #107 · 20.5K reputationPosted Dec 5, 2011, 8:37 AM EST
Alok PandeyRank #271 · 9.3K reputationPosted Dec 5, 2011, 6:22 PM EST