0

I am attempting to add a simple toolstrip however I can't get it to show up on the screen here is all the code pertaining to it. Did I leave anything out?

Field:

  protected ToolStrip _commandToolStrip = new ToolStrip();

In the Constructor

     FillToolBar();
     _commandToolStrip.Visible = true;
     _commandToolStrip.BringToFront();

The Methods:

  private void FillToolBar()
  {

     _commandToolStrip.Dock = DockStyle.Right;
     _commandToolStrip.Visible = true;
     ToolStripButton commandButton = new ToolStripButton("test", convertIconToImage((System.Drawing.Icon)(resources.GetObject("$this.Icon"))), Command_NextWebPattern_Execute);
     _commandToolStrip.Items.Add(commandButton);
  }

   private Image convertIconToImage(Icon icon)
   {
      Bitmap bm = icon.ToBitmap();
      Image convertedImage = bm;
      return convertedImage;
   }

I cant seem to find any reason why it doesn't show.

jth41
  • 3,808
  • 9
  • 59
  • 109
  • 1
    and where are you adding it to your form? I.e. `this.Controls.add(_commandToolStrip)` – Adam Jul 02 '12 at 04:32

1 Answers1

1

Found the problem almost as soon as I posted the question.. Lol

I needed to be sure that the parent was set to my form

The ToolStrip Parent was never set. I will leave the question up for anyone else who makes the same dumb mistake :P

jth41
  • 3,808
  • 9
  • 59
  • 109