Thursday 26 April 2012

Simple Form Design With Menu Strip in c#





     To Make a application like this….. Kindly Follow the below steps...

  1.       Open VS 2008 à file à new à project à WindowsFormApplication 
 2.       Rename it as FormDesign.
 3.       Select View à Toolbox  à  TableLayoutPanel
 4.       Design it for your needs….
                 I created one and designed that  looks like below…

       5.       Where u want to put image just put PictureBox there from ToolBox..
 6.       Right click on PictureBox and select properties ..
 7.       In properties under image select Local Resource and then  browse  image and select it that will look like below…

      8.       Then I added one panel at right top of the form and added label in panel and rename the text of the label into “knowledge share”  and style of the font by it properties…
It looks like below…

        9.       Then add Panel for other table cells.
 10.   Insert MenuStrip from ToolBox for left bottom panel and set its dock property is left…
 11.   Then add menu items like PictureBox1, PictureBox2, PictureBox3.
 12.   Then add three PictureBoxes for right bottem panel...
It Looks Like below…

       13.   Then assign Pictures for(picture box 1, 2, 3) them  and change their “sizemode” property into zoom for better view of large size images…..
 14.   Then double click on the menu items and type the below codes for each menu items.

private void picture1ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pictureBox2.Visible = true;
            pictureBox3.Visible = false;
            pictureBox4.Visible = false;
        }

private void picture2ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pictureBox3.Visible = true;
            pictureBox2.Visible = false;
            pictureBox4.Visible = false;
        }

private void picture3ToolStripMenuItem_Click(object sender, EventArgs e)
        {
            pictureBox4.Visible=true;
            pictureBox2.Visible=false;
            pictureBox3.Visible=false;
  }
      15.   Then compile and run…


Click Here To Download Source

1 comment: