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.
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.
Dhanishtha DhumalPosted Jul 10, 2015, 8:03 AM
Rajeesh MenothPosted Jul 10, 2015, 7:13 AM
Sanjeeb LenkaPosted Jul 10, 2015, 5:02 AM
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);
}
}
}
Dhanishtha DhumalPosted Jul 10, 2015, 3:39 AM
Sanjeeb LenkaPosted Jul 10, 2015, 3:29 AM