majd kazaz

majd kazaz

  • NA
  • 3
  • 6.8k

System Drowing.Bitmap is a "type" but is used as a variable.. Please Help

Feb 23 2011 5:22 AM
hello there.
i am making a statement to display an image when a button is clicked, i am having an error when doning this, the error i am getting is the following:
System Drowing.Bitmap is a "type" but is used as a variable.. Please Help
System Drowing.Image is a "type" but is used as a variable.. Please Help

the code that i am using is the following:
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Group_Project_final
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void button2_Click(object sender, EventArgs e)
        {
            panel2.Visible = true;
            panel1.Visible = false;
            panel3.Visible = false;
        }

        private void button1_Click(object sender, EventArgs e)
        {
            panel1.Visible = true;
            panel2.Visible = false;
            panel3.Visible = false;
        }

        private void button3_Click(object sender, EventArgs e)
        {
            panel3.Visible = true;
            panel1.Visible = false;
            panel2.Visible = false;
        }

        private void button4_Click(object sender, EventArgs e )
        {
            if (button4.Text == "off")
               button4.Text = "on";
               
                //Bitmap image = new Bitmap("C:\\Users\\LionHeart\\Desktop\\PDI_individual_Project\\C#Practice\\WindowsFormsApplication2\\WindowsFormsApplication2\\Resources\\bedroom light on2.jpg");
                //pictureBox1.Image = image;

            else
                button4.Text = "off";

            if (button4.Text == "on")
           
            Bitmap = new Bitmap("C:\\Users\\LionHeart\\Desktop\\PDI_individual_Project\\C#Practice\\WindowsFormsApplication2\\WindowsFormsApplication2\\Resources\\bedroom light on2.jpg");
            pictureBox1.Image = Image;          
        }

     
        }

   
    }



if any one can help me sort that issue i will be very greatfull, thanks.

Answers (2)