C#.NET Program 9

Output:






















Code:

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 Question_9
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void radioButton1_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton1.Checked == true)
            {
                pictureBox1.Image = Image.FromFile("D://home practical//sem 4//vwp//Assignment//Assignment 1//Question 9//INDIA.jpg");
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            }
        }

        private void radioButton2_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton2.Checked == true)
            {
                pictureBox1.Image = Image.FromFile("D://home practical//sem 4//vwp//Assignment//Assignment 1//Question 9//CANADA.jpg");
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            }
        }

        private void radioButton3_CheckedChanged(object sender, EventArgs e)
        {
            if (radioButton3.Checked == true)
            {
                pictureBox1.Image = Image.FromFile("D://home practical//sem 4//vwp//Assignment//Assignment 1//Question 9//USA.jpg");
                pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage;
            }
        }
    }
}


No comments:

Post a Comment