Unit 2_Notes
Unit 2_Notes
4. Drawing Class:-
Drawing class is used in C# program for working with some drawing
operations such as like line, rectangle, circle.
5.Security Class:-
security classes are used to provide security to the member of the form by
including several components like excepections handler, I/O
controller and data Safety.
6. Database Class:-
these are include by using system database it work about all the database
connectivity process like add new record, delete record and modify record.
7. Registry Class:-
it is compulsory for every windows application because after drag and drop
any control. its compulsory to make registry every control in our application.
8. Mathematical Class:-
this class are used in C# windows project for performing the mathmatical
functions like Sin, Cos, Tang and Log etc.
Above all are the windows classes in C# for make interaction with C#
project.
After you select your C# project template and name your project, Visual
Studio opens a form for you. A form is a Windows user interface. Create a Hello
World application by adding controls to the form. Then run the app.
1. If you don't see the Toolbox option, you can open it from the menu bar.
Select View > Toolbox or Ctrl+Alt+X.
2. Expand Common Controls and select the Pin icon to dock
the Toolbox window.
3. Select the Button control and then drag it onto the form
After you add a button control to create an action, add a label control to send
text to.
1. Select the Label control from the Toolbox. Then drag it onto the form and
drop it beneath the Click this button.
TextBox control:
In Windows forms, TextBox plays an important role. With the help of
TextBox, the user can enter data in the application, it can be of a single line or
of multiple lines.
The TextBox is a class and it is defined
under System.Windows.Forms namespace. In C#, you can create a TextBox in
two different ways:
1. Design-Time: It is the simplest way to create a TextBox as shown in the
following steps:
Label Control.
2.4 Button, Checkbox, Radio Button.
Button:
A Button is an essential part of an application, or software, or webpage. It
allows the user to interact with the application or software.
For example, if a user wants to exit from the current application so, he/she
click the exit button which closes the application. It can be used to perform
many actions like to submit, upload, download, etc. according to the
requirement of your program. It can be available with different shape, size,
color, etc.
and you can reuse them in different applications. In .NET Framework, Button
class is used to represent windows button control and it is inherited
from ButtonBase class.
Radio Buttons: Radio buttons are often used in groups. When radio buttons are
stacked, they form an adversarial set, where only one option can be selected at a
time. This is done by linking all radio buttons in a group to a common parent
object.
Radio Button: Radio buttons are ideal when users need to make a single choice
from a set of mutually exclusive options. Common scenarios include selecting a
gender or choosing a mode of operation (e.g., "Light Mode" or "Dark Mode").
Listbox:
The ListBox class is used to represent the windows list box and also provide
different types of properties, methods, and events.
It is defined under System.Windows.Forms namespace. The ListBox class
contains three different types of collection classes, i.e.
ListBox.ObjectCollection: This class holds all the elements contained in
the ListBox control.
In C# you can create a ListBox in the windows form by using two different
ways:
Menus
Dependency properties for this control might be set by the control's default
style. If a property is set by a default style, the property might change from its
default value when the control appears in the application.
The default style is determined by which desktop theme is used when the
application is running.
Dialog boxes.
A dialog box usually contains one or more controls (child windows) with which
the user enters text, chooses options, or directs the action.
Windows also provides predefined dialog boxes that support common menu
items such as Open and Print.
Applications that use these menu items should use the common dialog boxes to
prompt for this user input, regardless of the type of application.