In C# Create a windows application which accepts the month number and displays the month name in a label. show the steps to follow in visual studio.
Dear Student ,
As per the requirement submitted above , kindly find the below solution.
Here a new Windows Forms Application in C# is created using Visual Studio 2017 with name "MonthsApplication".This application contains a form with name "Form1.cs".Below are the files associated with form1.
1.Form1.cs[Design]
2.Form1.Designer.cs
namespace MonthsApplication
{
partial class Form1
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should
be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Windows Form Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.groupBox1 = new System.Windows.Forms.GroupBox();
this.txtMonthNumber = new System.Windows.Forms.TextBox();
this.btnMonthName = new System.Windows.Forms.Button();
this.lblMonthName = new System.Windows.Forms.Label();
this.groupBox1.SuspendLayout();
this.SuspendLayout();
//
// groupBox1
//
this.groupBox1.Controls.Add(this.txtMonthNumber);
this.groupBox1.Location = new System.Drawing.Point(24, 12);
this.groupBox1.Name = "groupBox1";
this.groupBox1.Size = new System.Drawing.Size(249, 86);
this.groupBox1.TabIndex = 0;
this.groupBox1.TabStop = false;
this.groupBox1.Text = "Enter Month Number :";
//
// txtMonthNumber
//
this.txtMonthNumber.Font = new System.Drawing.Font("Microsoft Sans
Serif", 12F, System.Drawing.FontStyle.Regular,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.txtMonthNumber.Location = new System.Drawing.Point(21,
31);
this.txtMonthNumber.Multiline = true;
this.txtMonthNumber.Name = "txtMonthNumber";
this.txtMonthNumber.Size = new System.Drawing.Size(207, 29);
this.txtMonthNumber.TabIndex = 0;
//
// btnMonthName
//
this.btnMonthName.Location = new System.Drawing.Point(75,
116);
this.btnMonthName.Name = "btnMonthName";
this.btnMonthName.Size = new System.Drawing.Size(117, 29);
this.btnMonthName.TabIndex = 1;
this.btnMonthName.Text = "&Display Month Name";
this.btnMonthName.UseVisualStyleBackColor = true;
this.btnMonthName.Click += new
System.EventHandler(this.btnMonthName_Click);
//
// lblMonthName
//
this.lblMonthName.Font = new System.Drawing.Font("Microsoft Sans
Serif", 20F, System.Drawing.FontStyle.Italic,
System.Drawing.GraphicsUnit.Point, ((byte)(0)));
this.lblMonthName.Location = new System.Drawing.Point(12,
162);
this.lblMonthName.Name = "lblMonthName";
this.lblMonthName.Size = new System.Drawing.Size(261, 54);
this.lblMonthName.TabIndex = 2;
this.lblMonthName.TextAlign =
System.Drawing.ContentAlignment.MiddleCenter;
//
// Form1
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.ClientSize = new System.Drawing.Size(285, 225);
this.Controls.Add(this.btnMonthName);
this.Controls.Add(this.lblMonthName);
this.Controls.Add(this.groupBox1);
this.Name = "Form1";
this.Text = "Months Application";
this.groupBox1.ResumeLayout(false);
this.groupBox1.PerformLayout();
this.ResumeLayout(false);
}
#endregion
private System.Windows.Forms.GroupBox groupBox1;
private System.Windows.Forms.TextBox txtMonthNumber;
private System.Windows.Forms.Button btnMonthName;
private System.Windows.Forms.Label lblMonthName;
}
}
3.Form1.cs
//namespace
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
//application namespace
namespace MonthsApplication
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
//Month name button
private void btnMonthName_Click(object sender, EventArgs e)
{
//taking month number entered by user
int monthNumber;
if(int.TryParse(txtMonthNumber.Text,out monthNumber))
{
//display month name on the label
lblMonthName.Text=
CultureInfo.CurrentCulture.DateTimeFormat.GetMonthName(monthNumber);
}
else
{
//display invalid message
lblMonthName.Text = "Enter valid number from 1 to 12";
}
}
}
}
======================================================
Output : Run application using F5 and will get the screen as shown below
Screen 1 :
Screen 2:Screen when invalid number is entered
Screen 3:Screen showing month name
Screen 4:Screen showing month name
NOTE : PLEASE FEEL FREE TO PROVIDE FEEDBACK ABOUT THE SOLUTION.
In C# Create a windows application which accepts the month number and displays the month name in a label. show the steps...
Write a C# Windows Form program that asks the user to enter a name (in a TextBox) and displays the following message (in a Label): Hello, yourName! https://youtu.be/6nNiMeWK37w can be helpful... (unfortunately the sound did not record) You will use Visual studio to complete this task. The final deliverable to be uploaded to the assignment dropbox is the entire visual studio solution folder that has been compressed or zipped.
Written in C# visual studio (Please show step by step) Create an application that can be used to allow users to enter information such as their names, e-mail addresses, and phone numbers. The application should provide a minimum of four features. The first retrieves and displays the information entered by the user. Output should be displayed in a Windows dialog message box. The second feature clears the entries so that new values can be entered. Provide an “About” feature under...
**This program is to be created using Visual Studio C#**Create as a Windows Form application** 1. Output a header in the console: “This is a replacement program” 1. Output a header that states: “This is Program 5” 2. Output a thank you message: “Thank you for running the program.”
PLEASE USE VISUAL BASIC* BY VISUAL STUDIO.
Visual Basic INTERMEDIATE Create a Windows Forms application. Use the following names for the project and solution, respectively: Chopkins Project and Chopkins Solution. Save the application in the VB2017\Chap03 folder. Change the form file's name to Main Form.vb. Change the form's name to frmMain. Create the interface shown in Figure 3-37. The interface contains six labels, three text boxes, and two buttons. The application calculates and displays the total number of packs ordered...
Q1. Create a Windows Form or MFC Dialog-based application that reads and displays an image, and then uses a slider to resize it from 0 to 100% size (zoom out but at different levels)
INSTRUCTIONS #6. Your science teacher has asked you to create an application that displays how much a person would weigh on the following planets: Venus, Mars, and Jupiter. The application's interface should allow the user to enter the person's weight on Earth. Perform the steps involved in creating an OO application. (See the Note at the beginning of the Exercises section.) Include a button for clearing the screen. . Create an application, using the following names for the solution and...
For C# Scenario: Create a Windows Forms application that accepts the total cost of a sale and the amount submitted by the customer. Calculate and display the correct change from largest denomination to smallest. If the cost exceeds the amount submitted, post a message to the user that they have entered an invalid amount. The program should accept both the cost and the amount submitted into textbox controls. The program should use Try/Catch statements to keep the program from crashing....
write pseudocode for a python application that accepts 10 numbers and displays the second lowest number.
Programming question. Using Visual Studio 2019 C#. Windows Forms Application. Write the code that assigns the number 15 to the reward variable when the state variable contains the string “IL” (entered using any case) and the sales variable contains a number that is greater than 2000; otherwise, assign the number 5.
In Java please
Create a GUI application that accepts student registration data. The GUI with valid data Shudent Fagtrtion x Rt Name Haold Moore Lst Name Yar of Brth 2001 Temporary PesowordHal200 Wlcome Harald Moore! RegsterEt The GUI with invalid data Shudent Fegtrtion DX Fect Name Haold Last Name ar of Brth 2001 Tempoay Pawod Haold 200 Pesse eer St and lact name and ye of bith Regster Et Specifications Use FXML to create the GUI The text box that...