SlideShare a Scribd company logo
1 of 16
C#
Day 2
Lecture12: Form Design
Form Design: MessageBox
using System;
using System.Text;
using System.Windows.Forms;
public class HelloWorld
{
public static void Main()
{
MessageBox.Show("Hello World!");
}
}
Form Design: TextBox
private void button1_Click(object sender, EventArgs e)
{
text1.Text = textBox1.Text.ToString();
text2.Text = textBox2.Text.ToString();
MessageBox.Show("You've successfully logged in.","Log in");
}
Form Design: Label
private void button1_Click(object sender, EventArgs e)
{
label1.Text = label1.Text.ToString().ToUpper();
label2.Text = label2.Text.ToString().ToLower();
MessageBox.Show("You've successfully logged in.","Log in");
}
Form Design: CheckBox
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if(checkBox1.Checked)
textBox2.UseSystemPasswordChar = false;
else
textBox2.UseSystemPasswordChar = true;
}
}
Form Design: CheckBox
private void button1_Click(object sender, EventArgs e)
{
textBox1.Text = textBox1.Text.ToString();
textBox2.Text = textBox2.Text.ToString();
MessageBox.Show("You've successfully logged in.","Log in");
}
private void checkBox1_CheckedChanged(object sender, EventArgs e)
{
if (checkBox1.Checked)
{ textBox2.UseSystemPasswordChar = false; }
else
{ textBox2.UseSystemPasswordChar = true; }
}
Form Design: RadioButton
string radio="radio";
private void radioButton1_CheckedChanged(object sender, EventArgs e)
{
radio = "Button1";
}
private void radioButton2_CheckedChanged(object sender, EventArgs e)
{
radio = "Button2";
}
Form Design: PictureBox
private void pictureBox1_Click(object sender, EventArgs e)
{
pictureBox1.SizeMode.GetType();
}
Windows Form Design
• Let's design a Form.
Windows Form Design: Make PDF
• Write some code to generate a PDF.
• Hint:
- First design a form
- Use some methods
Windows Form Design: Make PDF
Windows Form Design: Make PDF
using System.IO;
using iTextSharp.text;
using iTextSharp.text.pdf;
private void button1_Click(object sender, EventArgs e)
{ Document doc = new Document(iTextSharp.text.PageSize.LETTER, 25, 25, 30, 20);
PdfWriter myPDF = PdfWriter.GetInstance(doc, new FileStream(textBox1.Text.ToString()
+ ".pdf", FileMode.Create));
Paragraph pri = new Paragraph(textBox2.Text.ToString());
doc.Open();
doc.Add(pri);
doc.Close();
MessageBox.Show("Saved");
}
This slide is provided as a course material in the workshop named
“Workshop on C# Programming: Learn to Build”.
Organized by-
East West University Computer Programming Club (EWUCoPC)
Prepared by-
Jannat Binta Alam
Campus Ambassador
Young Engineers Society (YES)
E-mail: jannat.cse.ewu@gmail.com

More Related Content

Similar to Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)

Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)Chhom Karath
 
Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Bhushan Mulmule
 
Calculator Program in C#.NET
Calculator Program in C#.NET Calculator Program in C#.NET
Calculator Program in C#.NET Dhairya Joshi
 
Inventory management
Inventory managementInventory management
Inventory managementRajeev Sharan
 
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAMPROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAMSaraswathiRamalingam
 
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docxMicrosoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docxscroghamtressie
 
06 win forms
06 win forms06 win forms
06 win formsmrjw
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บทMareenaHahngeh
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บทMareenaHahngeh
 
Creating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdfCreating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdfShaiAlmog1
 
Introtodotnet
IntrotodotnetIntrotodotnet
Introtodotnetrashmix
 

Similar to Windows Form - Lec12 (Workshop on C# Programming: Learn to Build) (20)

Tutorial 6.docx
Tutorial 6.docxTutorial 6.docx
Tutorial 6.docx
 
Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)Chapter ii c#(building a user interface)
Chapter ii c#(building a user interface)
 
Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5Windows Forms For Beginners Part 5
Windows Forms For Beginners Part 5
 
Calculator Program in C#.NET
Calculator Program in C#.NET Calculator Program in C#.NET
Calculator Program in C#.NET
 
Tips android
Tips androidTips android
Tips android
 
Inventory management
Inventory managementInventory management
Inventory management
 
Ditec esoft C# project
Ditec esoft C# projectDitec esoft C# project
Ditec esoft C# project
 
Ditec esoft C# project
Ditec esoft C# project Ditec esoft C# project
Ditec esoft C# project
 
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAMPROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
PROGRAMMING USING C#.NET SARASWATHI RAMALINGAM
 
Create our own keylogger
Create our own keyloggerCreate our own keylogger
Create our own keylogger
 
Create our own keylogger
Create our own keyloggerCreate our own keylogger
Create our own keylogger
 
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docxMicrosoft Visual C# 2012- An introduction to object-oriented programmi.docx
Microsoft Visual C# 2012- An introduction to object-oriented programmi.docx
 
4.C#
4.C#4.C#
4.C#
 
06 win forms
06 win forms06 win forms
06 win forms
 
C#
C#C#
C#
 
Soa lab
Soa lab   Soa lab
Soa lab
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
 
โครงการ 5 บท
โครงการ 5 บทโครงการ 5 บท
โครงการ 5 บท
 
Creating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdfCreating a Facebook Clone - Part XXXV - Transcript.pdf
Creating a Facebook Clone - Part XXXV - Transcript.pdf
 
Introtodotnet
IntrotodotnetIntrotodotnet
Introtodotnet
 

More from Jannat Ruma

Class C# - Lec11 (Workshop on C# Programming: Learn to Build)
Class C# - Lec11 (Workshop on C# Programming: Learn to Build)Class C# - Lec11 (Workshop on C# Programming: Learn to Build)
Class C# - Lec11 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
String C# - Lec10 (Workshop on C# Programming: Learn to Build)
String C# - Lec10 (Workshop on C# Programming: Learn to Build)String C# - Lec10 (Workshop on C# Programming: Learn to Build)
String C# - Lec10 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)Method C# - Lec8 (Workshop on C# Programming: Learn to Build)
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Variable C# - Lec5 (Workshop on C# Programming: Learn to Build)
Variable  C# - Lec5 (Workshop on C# Programming: Learn to Build)Variable  C# - Lec5 (Workshop on C# Programming: Learn to Build)
Variable C# - Lec5 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)
Operator  C# - Lec3 (Workshop on C# Programming: Learn to Build)Operator  C# - Lec3 (Workshop on C# Programming: Learn to Build)
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)Jannat Ruma
 

More from Jannat Ruma (10)

Class C# - Lec11 (Workshop on C# Programming: Learn to Build)
Class C# - Lec11 (Workshop on C# Programming: Learn to Build)Class C# - Lec11 (Workshop on C# Programming: Learn to Build)
Class C# - Lec11 (Workshop on C# Programming: Learn to Build)
 
String C# - Lec10 (Workshop on C# Programming: Learn to Build)
String C# - Lec10 (Workshop on C# Programming: Learn to Build)String C# - Lec10 (Workshop on C# Programming: Learn to Build)
String C# - Lec10 (Workshop on C# Programming: Learn to Build)
 
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)Method C# - Lec8 (Workshop on C# Programming: Learn to Build)
Method C# - Lec8 (Workshop on C# Programming: Learn to Build)
 
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)
Loop C# - Lec7 (Workshop on C# Programming: Learn to Build)
 
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)
Decision Making C# - Lec6 (Workshop on C# Programming: Learn to Build)
 
Variable C# - Lec5 (Workshop on C# Programming: Learn to Build)
Variable  C# - Lec5 (Workshop on C# Programming: Learn to Build)Variable  C# - Lec5 (Workshop on C# Programming: Learn to Build)
Variable C# - Lec5 (Workshop on C# Programming: Learn to Build)
 
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
Type Casting C# - Lec4 (Workshop on C# Programming: Learn to Build)
 
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)
Operator  C# - Lec3 (Workshop on C# Programming: Learn to Build)Operator  C# - Lec3 (Workshop on C# Programming: Learn to Build)
Operator C# - Lec3 (Workshop on C# Programming: Learn to Build)
 
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
Data Type C# - Lec2 (Workshop on C# Programming: Learn to Build)
 
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
C# Basic - Lec1 (Workshop on C# Programming: Learn to Build)
 

Recently uploaded

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxGaneshChakor2
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...Pooja Nehwal
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfchloefrazer622
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...fonyou31
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Disha Kariya
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdfQucHHunhnh
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpinRaunakKeshri1
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdfSoniaTolstoy
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformChameera Dedduwage
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Sapana Sha
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfJayanti Pande
 

Recently uploaded (20)

CARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptxCARE OF CHILD IN INCUBATOR..........pptx
CARE OF CHILD IN INCUBATOR..........pptx
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...Russian Call Girls in Andheri Airport Mumbai WhatsApp  9167673311 💞 Full Nigh...
Russian Call Girls in Andheri Airport Mumbai WhatsApp 9167673311 💞 Full Nigh...
 
Arihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdfArihant handbook biology for class 11 .pdf
Arihant handbook biology for class 11 .pdf
 
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
Ecosystem Interactions Class Discussion Presentation in Blue Green Lined Styl...
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..Sports & Fitness Value Added Course FY..
Sports & Fitness Value Added Course FY..
 
1029-Danh muc Sach Giao Khoa khoi 6.pdf
1029-Danh muc Sach Giao Khoa khoi  6.pdf1029-Danh muc Sach Giao Khoa khoi  6.pdf
1029-Danh muc Sach Giao Khoa khoi 6.pdf
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Student login on Anyboli platform.helpin
Student login on Anyboli platform.helpinStudent login on Anyboli platform.helpin
Student login on Anyboli platform.helpin
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdfBASLIQ CURRENT LOOKBOOK  LOOKBOOK(1) (1).pdf
BASLIQ CURRENT LOOKBOOK LOOKBOOK(1) (1).pdf
 
A Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy ReformA Critique of the Proposed National Education Policy Reform
A Critique of the Proposed National Education Policy Reform
 
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
Mattingly "AI & Prompt Design: Structured Data, Assistants, & RAG"
 
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111Call Girls in Dwarka Mor Delhi Contact Us 9654467111
Call Girls in Dwarka Mor Delhi Contact Us 9654467111
 
Web & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdfWeb & Social Media Analytics Previous Year Question Paper.pdf
Web & Social Media Analytics Previous Year Question Paper.pdf
 

Windows Form - Lec12 (Workshop on C# Programming: Learn to Build)

  • 1.
  • 3. Form Design: MessageBox using System; using System.Text; using System.Windows.Forms; public class HelloWorld { public static void Main() { MessageBox.Show("Hello World!"); } }
  • 4. Form Design: TextBox private void button1_Click(object sender, EventArgs e) { text1.Text = textBox1.Text.ToString(); text2.Text = textBox2.Text.ToString(); MessageBox.Show("You've successfully logged in.","Log in"); }
  • 5. Form Design: Label private void button1_Click(object sender, EventArgs e) { label1.Text = label1.Text.ToString().ToUpper(); label2.Text = label2.Text.ToString().ToLower(); MessageBox.Show("You've successfully logged in.","Log in"); }
  • 6. Form Design: CheckBox private void checkBox1_CheckedChanged(object sender, EventArgs e) { if(checkBox1.Checked) textBox2.UseSystemPasswordChar = false; else textBox2.UseSystemPasswordChar = true; } }
  • 7. Form Design: CheckBox private void button1_Click(object sender, EventArgs e) { textBox1.Text = textBox1.Text.ToString(); textBox2.Text = textBox2.Text.ToString(); MessageBox.Show("You've successfully logged in.","Log in"); } private void checkBox1_CheckedChanged(object sender, EventArgs e) { if (checkBox1.Checked) { textBox2.UseSystemPasswordChar = false; } else { textBox2.UseSystemPasswordChar = true; } }
  • 8. Form Design: RadioButton string radio="radio"; private void radioButton1_CheckedChanged(object sender, EventArgs e) { radio = "Button1"; } private void radioButton2_CheckedChanged(object sender, EventArgs e) { radio = "Button2"; }
  • 9. Form Design: PictureBox private void pictureBox1_Click(object sender, EventArgs e) { pictureBox1.SizeMode.GetType(); }
  • 10. Windows Form Design • Let's design a Form.
  • 11.
  • 12.
  • 13. Windows Form Design: Make PDF • Write some code to generate a PDF. • Hint: - First design a form - Use some methods
  • 15. Windows Form Design: Make PDF using System.IO; using iTextSharp.text; using iTextSharp.text.pdf; private void button1_Click(object sender, EventArgs e) { Document doc = new Document(iTextSharp.text.PageSize.LETTER, 25, 25, 30, 20); PdfWriter myPDF = PdfWriter.GetInstance(doc, new FileStream(textBox1.Text.ToString() + ".pdf", FileMode.Create)); Paragraph pri = new Paragraph(textBox2.Text.ToString()); doc.Open(); doc.Add(pri); doc.Close(); MessageBox.Show("Saved"); }
  • 16. This slide is provided as a course material in the workshop named “Workshop on C# Programming: Learn to Build”. Organized by- East West University Computer Programming Club (EWUCoPC) Prepared by- Jannat Binta Alam Campus Ambassador Young Engineers Society (YES) E-mail: jannat.cse.ewu@gmail.com