Question

Using C#: Create a Form that consists of 3 radio buttons, two textboxes, a label and...

Using C#: Create a Form that consists of 3 radio buttons, two textboxes, a label and a button. The three radio buttons should represent the names of three fonts, e.g. “Arial”, “Calibri” and “Times New Roman”. In the one textbox, a user should type a message and in the other textbox, the user should type a size. When the user clicks the button, the label should be updated with the text the user typed in the one textbox, using the font selected with the radio buttons and the size typed in the other textbox.

0 0
Add a comment Improve this question Transcribed image text
Answer #1

Code

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

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

private void btnFormat_Click(object sender, EventArgs e)
{
int size = Convert.ToInt16(txtSize.Text);
string text = txtText.Text;
if (rdbArial.Checked)
{
lblAns.Font = new Font("Arial", size);
lblAns.Text = text;
}
if (rdbCalibri.Checked)
{
lblAns.Font = new Font("Calibri", size);
lblAns.Text = text;
}
if (rdbTimes.Checked)
{
lblAns.Font = new Font("Times New Roman", size);
lblAns.Text = text;
}
}
}
}
Design

outputs

If you have any query regarding the code please ask me in the comment i am here for help you. Please do not direct thumbs down just ask if you have any query. And if you like my work then please appreciates with up vote. Thank You.

Add a comment
Know the answer?
Add Answer to:
Using C#: Create a Form that consists of 3 radio buttons, two textboxes, a label and...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • Use visual studios language C++ to creat Form1 and Designer Form for question below 3. Form...

    Use visual studios language C++ to creat Form1 and Designer Form for question below 3. Form has three textboxes, two for input and one for output. Form also has five buttons, marked, ‘+’, ‘-’, ‘*’, ‘/’, ‘C’ respectively. User enters integers into the two textboxes, and clicks one of the four buttons (+, - , *, /). The third textbox shows the result of the corresponding operation. For example, if user entered 10 into the first textbox and 2 into...

  • Create a simple WPF application that consists of a simple form with three controls: 1.A text...

    Create a simple WPF application that consists of a simple form with three controls: 1.A text box for entering messages 2.A label where the message is copied to 3.A copy button that when is clicked the message in the textbox is copied to the label Make sure that label font size is 14 and its text is aligned in the center with a red background color. The button has yellow background color. Anchor the textbox to Top. (Use Visual Studio...

  • Create an order entry screen program in C# to give a total for an individual pizza...

    Create an order entry screen program in C# to give a total for an individual pizza order. The Pizza order should have radio buttons for small $7, medium $9, and large $12 choices for the pizza. There should be a checkbox for drink (where a drink is $2 added if it is checked and nothing added if it is not checked. Include a textbox for the customer’s name. Have a button to calculate the subtotal (pizza choice and whether there...

  • Using AndroidStudio Create a mobile app UI that has the following labels and textboxes. Customer Name...

    Using AndroidStudio Create a mobile app UI that has the following labels and textboxes. Customer Name Customer ID Customer Address The mobile app UI should also contain a Submit button. The following validation should be executed as soon as user clicks the Submit button. Customer ID should be between 0-1000. If user enters any value above 1000, then you need to display an error message. Customer Name should not contain any numeric characters. If user enters customer name with numbers,...

  • JAVA CODING Must be compilable, thanks The purpose is to provide an exercise in event-driven programming...

    JAVA CODING Must be compilable, thanks The purpose is to provide an exercise in event-driven programming and image handling using JavaFX. Create an application that responds to the user clicking command buttons. Initially, it will display one of two graphic images and, based upon the button clicked by the user, will switch the image displayed. If the user clicks the mouse button to display the same image as is currently displayed, the image is not changed, but a message at...

  • Using Java, please create the program for the following prompt. MUST CREATE BUTTONS IN A JFRAME,...

    Using Java, please create the program for the following prompt. MUST CREATE BUTTONS IN A JFRAME, as specified by the prompt! DO NOT use user input of 1, 2, 3 etc. User input must come from clicking the buttons. Please be sure to test your program. Thank you! Write a program that displays three buttons with the names or images of three candidates for public of office. Imagine that a person votes by clicking the button that shows the candidate...

  • NEED HELP DIRECTIONS: Notice that there is one input area and two buttons There is a...

    NEED HELP DIRECTIONS: Notice that there is one input area and two buttons There is a place in the HTML reserved for < li > elements under the heading “Shopping List” Write a javascript program that will cause whatever the user inputs to be placed in a newly -created < li > tag and the tag placed inside the < ul > element whenever the user clicks the button Your program must not create any < li > tag is...

  • I need the whole and correct code Form1.cs Form1.Designer.cs Form2.cs Form2.Designer.cs program.cs everything in details Create...

    I need the whole and correct code Form1.cs Form1.Designer.cs Form2.cs Form2.Designer.cs program.cs everything in details Create C# project of type "Windows Forms Application titled your name: 1. Change the form title to "YourName_Smart Convertor". (2 points) 2. Change the background color of the form to Cornsilk.(2 points) 3. Change the form size to 470 X350 (2 points) 4. Add a picture to the form as shown in the figure below. (2 points) 5. Adjust the picture size to be as...

  • Using Javascript, I have two radio buttons, depending on the value of the radio button 1...

    Using Javascript, I have two radio buttons, depending on the value of the radio button 1 or 2, you will send a different form to the user. So, if radio button is value "1" send new form1 or if value "2" send new form 2.  New form will ask for letter grades for four courses in textboxes. Onsubmit of new form letter grades A,B,C,D need to be changed to numeric values 1,2,3,4 so an average grade for the four couses can...

  • Project 2 Description Create a Visual C# project that when an employee's biweekly sales amount is...

    Project 2 Description Create a Visual C# project that when an employee's biweekly sales amount is entered and the Calculate button is pressed, the gross pay, deductions, and net pay will be displayed. Each employee will receive a base pay of $1200 plus a sales commission of 8% of sales. Once the net pay has been calculated, display the budget amount for each category listed below based on the percentages given.         base pay = $1200; use a named...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT