title: C# combobox with lines
body: <p>This is a different approach to what I was doing earlier. </p>
  
  <p>In my combo owner drawn combo box draw 3 lines(solid,dash,dashdot) to be drawn with the color selected from an earlier colpr picker drop down</p>
  
  <pre><code>this.DrawMode = DrawMode.OwnerDrawVariable;
              this.DropDownStyle = ComboBoxStyle.DropDownList;
       protected override void OnDrawItem(DrawItemEventArgs e)
          {
              e.DrawBackground();  
              int startX = e.Bounds.Left + 5;
              int startY = (e.Bounds.Y);
              Point p1=new Point(startX,startY);
              int endX = e.Bounds.Right - 5;
              int endY = (e.Bounds.Y);
               ComboBoxItem item = (ComboBoxItem)this.Items[e.Index];
              Point p2=new Point(endX,endY);
              base.OnDrawItem(e);
              Pen SolidmyPen = new Pen(item.foreColor, 1);
              Pen DashedPen = new Pen(item.foreColor, 1);
              DashedPen.DashStyle = System.Drawing.Drawing2D.DashStyle.Dash;
              Pen DashDot = new Pen(item.foreColor, 1);
              DashDot.DashStyle = System.Drawing.Drawing2D.DashStyle.DashDot;
             // Pen DashedPen = new Pen(item.foreColor, (Int32)this.Items[e.Index]);
  
              Bitmap myBitmap = new Bitmap(item.Picture);
              Graphics graphicsObj;
              graphicsObj = Graphics.FromImage(myBitmap);
              switch (e.Index)
              {
                  case 0:
                      graphicsObj.DrawLine(SolidmyPen, p1, p2);
                      break;
                  case 1:
                      graphicsObj.DrawLine(DashedPen, p1, p2);
                      break;
                  case 2:
                      graphicsObj.DrawLine(DashDot, p1, p2);
                      break;
  
  
              }
  </code></pre>
  
  <p>Here's what I'm trying to do. Draw 3lines(solid,dash,dashdot) in the combo box. </p>
  
  <p>I don't see any lines in the combo box except some blue which is the selected color</p>
  
  <p>Thank u</p>