Question

In: Computer Science

Using C#: Create a Form that consists of a PictureBox and 3 radio buttons. Assign an...

Using C#: Create a Form that consists of a PictureBox and 3 radio buttons. Assign an image of your choice to the PictureBox. Each radio button should be associated with a specific PictureBox size mode. When the user clicks on a specific radio button, the PictureBox's size mode should be changed to reflect the selection.

Solutions

Expert Solution

Below is the aolution

using System;
using System.Drawing;
using System.Windows.Forms;

namespace ResizePictureBox
{
    public partial class frmMain : Form
    {
        public frmMain()
        {
            InitializeComponent();
        }
        //radio button size100 click event
        private void Size100(object sender, EventArgs e)
        {
            pictureBox1.Size = new Size(100, 100); //set the picturebox size
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; //stretch image
            pictureBox1.BorderStyle = BorderStyle.Fixed3D; //border style 3d
        }
        //radio button size200 click event
        private void Size200(object sender, EventArgs e)
        {
            pictureBox1.Size = new Size(200, 200); //set the picturebox size
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; //stretch image
            pictureBox1.BorderStyle = BorderStyle.Fixed3D; //border style 3d
        }
        //radio button size300 click event
        private void Size300(object sender, EventArgs e)
        {
            pictureBox1.Size = new Size(300, 300); //set the picturebox size
            pictureBox1.SizeMode = PictureBoxSizeMode.StretchImage; //stretch image
            pictureBox1.BorderStyle = BorderStyle.Fixed3D; //border style 3d
        }

        private void frmMain_Load(object sender, EventArgs e)
        {
            CenterToScreen(); //window center on the window
        }
    }
}

sample image:


Related Solutions

Using C#: Create a Form that consists of 4 checkboxes, three radio buttons, a label and...
Using C#: Create a Form that consists of 4 checkboxes, three radio buttons, a label and a button. The 4 checkboxes represent pizza toppings. The three radiobuttons should represent three sizes of pizza, namely “small”, “medium” and “large”. When the user clicks the button you need to calculate the price of the pizza. The calculation should be done as follows: count up the cost of the selected ingredients (you may assign your own prices for the ingredients) and then multiply...
Please complete in C# and use radio buttons on the form for the selections. Thank you!...
Please complete in C# and use radio buttons on the form for the selections. Thank you! For this assignment, you will be creating a Dorm and Meal Plan Calculator. A university has the following dormitories: Allen Hall $1,500 per semester Pike Hall $1,600 per semester Farthing Hall $1,800 per semester University Suites $2,500 per semester The university also offers the following meal plans: 7 meals per week $ 600 per semester 14 meals per week $1,200 per semester Unlimited meals...
Create a Java Swing form that will have two Buttons: (1) the first linked to an...
Create a Java Swing form that will have two Buttons: (1) the first linked to an event handler to write data from two TextFields on the form to an output file; and (2) the other with an event handler to read data from the same file as input and write output to a binary ObjectOutputStream file.
Create your own data type using a C++ structure. Assign values to a variable of that...
Create your own data type using a C++ structure. Assign values to a variable of that data type. Retrieve values from the variable of that data type. Description: In this lab you will choose the statements to create a program that: Creates a brand new data type called "Monster". Once created, creates a variable of type Monster and assign values to the variable and then display the contents. This lab will again take the form of a guided multiple-choice quiz...
PYTHON PROGRAMMING Using tktinker, create a gui that surrounds the code below that has buttons and...
PYTHON PROGRAMMING Using tktinker, create a gui that surrounds the code below that has buttons and labels and an overall theme. # Meet the chatbot Eve print('Hi there! Welcome to the ChatBot station. I am going to ask you a series of questions and all you have to do is answer!') print(' ') print('Lets get started') #begin questions firstName = input('What is your first name?: ') lastName = input('What is your last name? ') print("Hi there, ", firstName + lastName,...
In C create an array of 4 integers. Assign a pointer to the array. Use the...
In C create an array of 4 integers. Assign a pointer to the array. Use the pointer to find the average value of the elements in the array and display the results on the screen.
This is in HTML and JavaScript So I have 2 radio buttons One called students and...
This is in HTML and JavaScript So I have 2 radio buttons One called students and one called teacher. If the user selects the student then a list of check boxes these should appear. These should not be visable if the user selects the teacher radio button. - buy text books - visit teachers website - attend class If the user selects the teacher radio button then all the text boxes above should be hidden From the user. Then these...
Write an application with three radio buttons labeled “Cyan”, “Magenta”, and “Orange” that changes the background...
Write an application with three radio buttons labeled “Cyan”, “Magenta”, and “Orange” that changes the background color of a panel in the center of the frame to CYAN, MAGENTA, or ORANGE. This is required to be programmed in Java.
Using C# Windows App Form Create a simple calculator using +,-,*,/ Please show code GUI Code...
Using C# Windows App Form Create a simple calculator using +,-,*,/ Please show code GUI Code for calculator menus radio button input text boxes
Create an ASP.Net Website using Visual Studio with C#: Create a simple calculator that has 3...
Create an ASP.Net Website using Visual Studio with C#: Create a simple calculator that has 3 text boxes: 2 of them to enter numbers, the 3rd one displays the results Create 4 buttons to add, subtract, multiply, and divide Prevent the user from entering text in the number fields Display a message indicating “cannot divide by” when the user click “/” and there is a zero the in the second box Create two additional buttons: - One to store data...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT