SlideShare a Scribd company logo
1 of 6
Download to read offline
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int monthNumber;
int.TryParse(inputTextBox.Text, out monthNumber);
if (monthNumber < 1 || monthNumber > 12)
{
MessageBox.Show("Please enter an integer between 1 and 12");
inputTextBox.Focus();
return;
}
string monthName = ((Month)monthNumber).ToString();
MessageBox.Show("You entered the month number for " + monthName);
inputTextBox.Clear();
inputTextBox.Focus();
}
}
}
Solution
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
namespace MonthNamesGUI
{
public partial class Form1 : Form
{
enum Month
{
January = 1,
February,
March,
April,
May,
June,
July,
August,
September,
October,
November,
December
};
public Form1()
{
InitializeComponent();
}
private void button1_Click(object sender, EventArgs e)
{
int monthNumber;
int.TryParse(inputTextBox.Text, out monthNumber);
if (monthNumber < 1 || monthNumber > 12)
{
MessageBox.Show("Please enter an integer between 1 and 12");
inputTextBox.Focus();
return;
}
string monthName = ((Month)monthNumber).ToString();
MessageBox.Show("You entered the month number for " + monthName);
inputTextBox.Clear();
inputTextBox.Focus();
}
}
}

More Related Content

More from anujmkt

While doing capital investment, CFO analyze all the risk related to .pdf
While doing capital investment, CFO analyze all the risk related to .pdfWhile doing capital investment, CFO analyze all the risk related to .pdf
While doing capital investment, CFO analyze all the risk related to .pdf
anujmkt
 
What is Network security, or Securiing your data Through Network,N.pdf
What is Network security, or Securiing your data Through Network,N.pdfWhat is Network security, or Securiing your data Through Network,N.pdf
What is Network security, or Securiing your data Through Network,N.pdf
anujmkt
 
The scanner performs lexical analysis of a precise program (in our c.pdf
The scanner performs lexical analysis of a precise program (in our c.pdfThe scanner performs lexical analysis of a precise program (in our c.pdf
The scanner performs lexical analysis of a precise program (in our c.pdf
anujmkt
 
solimportance for an organization to implement an enterprise system.pdf
solimportance for an organization to implement an enterprise system.pdfsolimportance for an organization to implement an enterprise system.pdf
solimportance for an organization to implement an enterprise system.pdf
anujmkt
 
We use the complementation principle. Clearly the.pdf
                     We use the complementation principle. Clearly the.pdf                     We use the complementation principle. Clearly the.pdf
We use the complementation principle. Clearly the.pdf
anujmkt
 
Please follow the data and description EBNF In the stream of c.pdf
Please follow the data and description EBNF In the stream of c.pdfPlease follow the data and description EBNF In the stream of c.pdf
Please follow the data and description EBNF In the stream of c.pdf
anujmkt
 
Program of sorting using shell sort #include stdio.h #de.pdf
 Program of sorting using shell sort  #include stdio.h #de.pdf Program of sorting using shell sort  #include stdio.h #de.pdf
Program of sorting using shell sort #include stdio.h #de.pdf
anujmkt
 
For governments that implement GASB Statement No. 34, the fund finan.pdf
For governments that implement GASB Statement No. 34, the fund finan.pdfFor governments that implement GASB Statement No. 34, the fund finan.pdf
For governments that implement GASB Statement No. 34, the fund finan.pdf
anujmkt
 

More from anujmkt (20)

While doing capital investment, CFO analyze all the risk related to .pdf
While doing capital investment, CFO analyze all the risk related to .pdfWhile doing capital investment, CFO analyze all the risk related to .pdf
While doing capital investment, CFO analyze all the risk related to .pdf
 
What is Network security, or Securiing your data Through Network,N.pdf
What is Network security, or Securiing your data Through Network,N.pdfWhat is Network security, or Securiing your data Through Network,N.pdf
What is Network security, or Securiing your data Through Network,N.pdf
 
TrueClay it the important of soil for holding plant nutrients in t.pdf
TrueClay it the important of soil for holding plant nutrients in t.pdfTrueClay it the important of soil for holding plant nutrients in t.pdf
TrueClay it the important of soil for holding plant nutrients in t.pdf
 
The statement is FalseOnly single target target agents are sunject.pdf
The statement is FalseOnly single target target agents are sunject.pdfThe statement is FalseOnly single target target agents are sunject.pdf
The statement is FalseOnly single target target agents are sunject.pdf
 
The reactants along with the oxidation states are Zn = 0 CuSO4.pdf
The reactants along with the oxidation states are Zn = 0 CuSO4.pdfThe reactants along with the oxidation states are Zn = 0 CuSO4.pdf
The reactants along with the oxidation states are Zn = 0 CuSO4.pdf
 
The scanner performs lexical analysis of a precise program (in our c.pdf
The scanner performs lexical analysis of a precise program (in our c.pdfThe scanner performs lexical analysis of a precise program (in our c.pdf
The scanner performs lexical analysis of a precise program (in our c.pdf
 
Solution Pseudoextinction refers to- D) a species evolving to t.pdf
Solution Pseudoextinction refers to- D) a species evolving to t.pdfSolution Pseudoextinction refers to- D) a species evolving to t.pdf
Solution Pseudoextinction refers to- D) a species evolving to t.pdf
 
Share Holders Equity = Current Assets + Net Fixed Assets - Current.pdf
Share Holders Equity = Current Assets + Net Fixed Assets - Current.pdfShare Holders Equity = Current Assets + Net Fixed Assets - Current.pdf
Share Holders Equity = Current Assets + Net Fixed Assets - Current.pdf
 
The correct answer for m_1=2 is 2,3 for lSolutionThe corre.pdf
The correct answer for m_1=2 is 2,3 for lSolutionThe corre.pdfThe correct answer for m_1=2 is 2,3 for lSolutionThe corre.pdf
The correct answer for m_1=2 is 2,3 for lSolutionThe corre.pdf
 
solimportance for an organization to implement an enterprise system.pdf
solimportance for an organization to implement an enterprise system.pdfsolimportance for an organization to implement an enterprise system.pdf
solimportance for an organization to implement an enterprise system.pdf
 
We use the complementation principle. Clearly the.pdf
                     We use the complementation principle. Clearly the.pdf                     We use the complementation principle. Clearly the.pdf
We use the complementation principle. Clearly the.pdf
 
right idea but numbers are wrong all over the placeSolution.pdf
right idea but numbers are wrong all over the placeSolution.pdfright idea but numbers are wrong all over the placeSolution.pdf
right idea but numbers are wrong all over the placeSolution.pdf
 
Please follow the data and description EBNF In the stream of c.pdf
Please follow the data and description EBNF In the stream of c.pdfPlease follow the data and description EBNF In the stream of c.pdf
Please follow the data and description EBNF In the stream of c.pdf
 
Program of sorting using shell sort #include stdio.h #de.pdf
 Program of sorting using shell sort  #include stdio.h #de.pdf Program of sorting using shell sort  #include stdio.h #de.pdf
Program of sorting using shell sort #include stdio.h #de.pdf
 
The sample proportion falls between 0.4 and 0.6Solution The s.pdf
 The sample proportion falls between 0.4 and 0.6Solution The s.pdf The sample proportion falls between 0.4 and 0.6Solution The s.pdf
The sample proportion falls between 0.4 and 0.6Solution The s.pdf
 
+0.35, as the scatter is not showing any significant relationship to.pdf
+0.35, as the scatter is not showing any significant relationship to.pdf+0.35, as the scatter is not showing any significant relationship to.pdf
+0.35, as the scatter is not showing any significant relationship to.pdf
 
Here ABE is one planeBCD is another perpendicular plane from the g.pdf
Here ABE is one planeBCD is another perpendicular plane from the g.pdfHere ABE is one planeBCD is another perpendicular plane from the g.pdf
Here ABE is one planeBCD is another perpendicular plane from the g.pdf
 
For governments that implement GASB Statement No. 34, the fund finan.pdf
For governments that implement GASB Statement No. 34, the fund finan.pdfFor governments that implement GASB Statement No. 34, the fund finan.pdf
For governments that implement GASB Statement No. 34, the fund finan.pdf
 
Ethical theories are often divided into three types -1) Consequent.pdf
Ethical theories are often divided into three types -1) Consequent.pdfEthical theories are often divided into three types -1) Consequent.pdf
Ethical theories are often divided into three types -1) Consequent.pdf
 
D. The International Organization on Computer Evidence (IOCE) was ap.pdf
D. The International Organization on Computer Evidence (IOCE) was ap.pdfD. The International Organization on Computer Evidence (IOCE) was ap.pdf
D. The International Organization on Computer Evidence (IOCE) was ap.pdf
 

Recently uploaded

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
EADTU
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
EADTU
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MysoreMuleSoftMeetup
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
中 央社
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
CaitlinCummins3
 

Recently uploaded (20)

Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
Transparency, Recognition and the role of eSealing - Ildiko Mazar and Koen No...
 
Trauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical PrinciplesTrauma-Informed Leadership - Five Practical Principles
Trauma-Informed Leadership - Five Practical Principles
 
PSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptxPSYPACT- Practicing Over State Lines May 2024.pptx
PSYPACT- Practicing Over State Lines May 2024.pptx
 
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptxAnalyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
Analyzing and resolving a communication crisis in Dhaka textiles LTD.pptx
 
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
TỔNG HỢP HƠN 100 ĐỀ THI THỬ TỐT NGHIỆP THPT TOÁN 2024 - TỪ CÁC TRƯỜNG, TRƯỜNG...
 
diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....diagnosting testing bsc 2nd sem.pptx....
diagnosting testing bsc 2nd sem.pptx....
 
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes GuàrdiaPersonalisation of Education by AI and Big Data - Lourdes Guàrdia
Personalisation of Education by AI and Big Data - Lourdes Guàrdia
 
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
MuleSoft Integration with AWS Textract | Calling AWS Textract API |AWS - Clou...
 
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文會考英文
 
Including Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdfIncluding Mental Health Support in Project Delivery, 14 May.pdf
Including Mental Health Support in Project Delivery, 14 May.pdf
 
SURVEY I created for uni project research
SURVEY I created for uni project researchSURVEY I created for uni project research
SURVEY I created for uni project research
 
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of TransportBasic Civil Engineering notes on Transportation Engineering & Modes of Transport
Basic Civil Engineering notes on Transportation Engineering & Modes of Transport
 
8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management8 Tips for Effective Working Capital Management
8 Tips for Effective Working Capital Management
 
Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"Mattingly "AI and Prompt Design: LLMs with NER"
Mattingly "AI and Prompt Design: LLMs with NER"
 
Rich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdfRich Dad Poor Dad ( PDFDrive.com )--.pdf
Rich Dad Poor Dad ( PDFDrive.com )--.pdf
 
How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17How To Create Editable Tree View in Odoo 17
How To Create Editable Tree View in Odoo 17
 
Supporting Newcomer Multilingual Learners
Supporting Newcomer  Multilingual LearnersSupporting Newcomer  Multilingual Learners
Supporting Newcomer Multilingual Learners
 
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptxCOMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
COMMUNICATING NEGATIVE NEWS - APPROACHES .pptx
 
How to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptxHow to Manage Website in Odoo 17 Studio App.pptx
How to Manage Website in Odoo 17 Studio App.pptx
 
Graduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptxGraduate Outcomes Presentation Slides - English (v3).pptx
Graduate Outcomes Presentation Slides - English (v3).pptx
 

namespace MonthNamesGUI{public partial class Form1 Form{en.pdf