I am using Windows application in c#. I am adding checklistbox items dynamically.Now i wnt to increase vertical height between items of checklist box.So how can i do it. please give me idea how to do it
Thank You.
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
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 10, 2015, 1:02 AM EDT
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public sealed class MyListBox : CheckedListBox
{
public MyListBox()
{
ItemHeight = 30;
}
public override int ItemHeight { get; set; }
}
}
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace WindowsFormsApplication1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
MyListBox cb = new MyListBox();
var items = cb.Items;
items.Add("Perls");
items.Add("diamond");
items.Add("Perls");
items.Add("diamond");
items.Add("Perls");
items.Add("diamond");
items.Add("Perls");
items.Add("diamond");
this.Controls.Add(cb);
}
}
}
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Jul 9, 2015, 11:29 PM EDT
Dhanishtha Dhumal10 reputationPosted Jul 9, 2015, 11:39 PM EDT
Rajeesh MenothRank #118 · 18.4K reputationPosted Jul 10, 2015, 3:13 AM EDT
Dhanishtha Dhumal10 reputationPosted Jul 10, 2015, 4:03 AM EDT