C sharp slybs
C sharp slybs
using System;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
2: How we use load command in C sharp form
using System;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
}
3: How we make a button in C sharp form
using System;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
}
4: How we show a message on clicking a
button
And change background color of a button
using System;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
using System;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
}
// By using query.
using System;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
// by using list.
using System;
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
}
}
}
8: Assignment Questions
Assignment Question
Step-1
Create a Windows Form application in C# with a TextBox control.
Implement functionality to allow users to enter text into the TextBox.
Write code to display a message box with the entered text when a button is
clicked.
namespace WindowsFormsApp1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Step-3
Create a Windows Form application with two TextBox controls.
Designate one TextBox as a regular text input and the other as a password input.
Implement functionality to display the entered text in the regular TextBox and hide it with
asterisks (*) in the password TextBox.
Step-4
Develop a Windows Form application with a multiline TextBox control.
Allow users to enter multiple lines of text.
Implement a feature to count and display the number of lines entered in a label or another
TextBox.
Step-7
Develop a Windows Form application with a TextBox for phone number input.
Implement an input mask to format the phone number as the user types (e.g., (123) 456-
7890)
this.Controls.Add(b1);
How to set Name of the ComboBox in C#?
How to Sort the Elements of the ComboBox in C#?
How to set the Visibility of the ComboBox in C#?
How to Set the Foreground Color of the ComboBox in C#?
How to set the font of the content present in the ComboBox in C#?
How to set the Size of the ComboBox in C#?
How to Add Items in ComboBox in C#?
How to set the Location of the ComboBox in C#?
How to set the Padding of the button in C#?
How to set the Padding of the RadioButton in C#?
How to set the Size of the Label in C#?
How to set the Foreground Color of the Label in C#?
How to set the Background Color of the Label in C#?
How to set the Font of the Content Present in the Label in C#?
How to set Text on the Label in C#?
How to Set the Location of the Label in C#?
How to set the Visibility of the Label in C#?
How to set the Alignment of the Text in the Label in C#?