C# combox box owner draw
<p>My combobox is empty. </p>

<pre><code>   public frmDlgGraphOptions()
    {

        InitializeComponent();
        this.comboBox1 = new System.Windows.Forms.ComboBox();
        arr = new String[4];
        arr[0] = "Solid Line";
        arr[1] = "Dashed line";
        arr[2] = "Dotted Line";
        arr[3] = "Dotted Line";
         imageArr = new Image[4];
         imageArr[0] = new Bitmap("C:\\SolidLine.png");
        imageArr[1] = new Bitmap("C:\\dashedline.png");
        imageArr[2] = new Bitmap("C:\\Dotted.png");
        imageArr[3] = new Bitmap("C:\\Dotted.png");

        comboBox1.DrawMode = DrawMode.OwnerDrawFixed;
        comboBox1.DropDownStyle = ComboBoxStyle.DropDownList;
        comboBox1.DrawItem += new DrawItemEventHandler(comboBox1_DrawItem);
        this.comboBox1.TabIndex = 1;    
        this.comboBox1.ForeColor = System.Drawing.Color.FromArgb(((System.Byte)(192)), ((System.Byte)(192)), ((System.Byte)(255)));
        this.comboBox1.ItemHeight = 20;
        this.comboBox1.Location = new System.Drawing.Point(84, 137);
        this.comboBox1.Name = "comboBox1";
        this.comboBox1.Size = new System.Drawing.Size(200, 26);
        groupBox1.Controls.Add(comboBox1);
</code></pre>

<p>Here's the code for OnDrawItem</p>

<pre><code> private void comboBox1_DrawItem(object sender, DrawItemEventArgs e)
    {
        // Let's highlight the currently selected item like any well 
        // behaved combo box should
        e.Graphics.FillRectangle(Brushes.Bisque, e.Bounds); 
        e.Graphics.DrawImage(imageArr[e.Index], new Point(e.Bounds.X, e.Bounds.Y));   
        e.Graphics.FillRectangle(Brushes.Bisque, e.Bounds);
        //is the mouse hovering over a combobox item??            
        if ((e.State &amp; DrawItemState.Focus) == 0)
        {
            //this code keeps the last item drawn from having a Bisque background. 
            e.Graphics.FillRectangle(Brushes.White, e.Bounds);

            e.Graphics.DrawImage(imageArr[e.Index], new Point(e.Bounds.X, e.Bounds.Y));
        }    
</code></pre>

<p>First of all, I dont see any items in the combo box. I see the empty combo box.
Also, when I hover on the combo box, e.index= -1 and throws an error</p>

<p>Thank u
Sun</p>

<pre><code>    }
</code></pre>
