0% found this document useful (0 votes)
4 views41 pages

Dot Net 2

The document provides a comprehensive overview of Visual Studio.NET, Visual Basic.NET, and the .NET Framework, including key components such as CLR, CTS, and FCL. It covers various programming concepts, including variable declaration, type conversion, control structures, loops, and exception handling, along with practical examples of using common dialog controls like ColorDialog and FontDialog. Additionally, it discusses the RichTextBox control and demonstrates how to create a Notepad application with features like opening, saving, and formatting text.

Uploaded by

priyalpatel1726
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views41 pages

Dot Net 2

The document provides a comprehensive overview of Visual Studio.NET, Visual Basic.NET, and the .NET Framework, including key components such as CLR, CTS, and FCL. It covers various programming concepts, including variable declaration, type conversion, control structures, loops, and exception handling, along with practical examples of using common dialog controls like ColorDialog and FontDialog. Additionally, it discusses the RichTextBox control and demonstrates how to create a Notepad application with features like opening, saving, and formatting text.

Uploaded by

priyalpatel1726
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

1.

Event driven modal


2. Visual [Link]
a. Features of [Link]
3. Visual [Link]
4. What is the .NET Framework?
a. CLR
b. CTS
c. CLS
d. Assembly
e. Metadata
f. FCL
g. Namespace
h. Garbage Collection
i. Execution Process of .NET program.
j. MSIL
k. JIT
5. IDE
6. First program
7. Exercise 1
8. Variable
a. Variable Declaration
b. Naming Convention
c. Data type
d. Variable Initialization
9. Type Conversion
10. Type Checking function
11. Option Explicit and Option Strict
12. Operators
a. Arithmetic
b. Concatenation
c. Assignment
d. Relational
e. Bitwise
f. Miscellaneous
13. IMP
a. Multiple statement in one line
b. One line in multiple statement
c. Startup form
d. Comment
e. Design time and Run time
14. Control Structure
a. If..Then…Else
b. Select…Case
15. Loops
a. For…Next
b. While
c. Do
d. For each..Next
16. With..End with
17. IMP
18. Msgbox , [Link] and InputBox
19. Procedure
a. Modular coding
b. Sub Procedure
c. Function
d. Optional Argument
e. Function Overloading
f. Pass by Val and Pass by Ref
g. Passing Argument
h. Event Procedure and Handlers
i. Exit
20. String class ‘s methods and property
21. Char class’s methods
22. Other special functions
23. Windows Form
a. Modal/Modeless
b. Share data from on Form to other Form
c. SDI/MDI
d. MDI form with MenuStrip control
e. Context Menu
24. Exercise 2
25. Exception handling
a. Types of Errors
b. Types of exception handling
c. Structured exception
d. Debugging Techniques
26. COM and DCOM
Common Dialog Control

[Link] contains built-in dialog boxes which allow us to create our own File Open, File
Save, Font, and Color dialogs control like we see in all the windows applications.

The Common dialog controls are given below:

1. Color Dialog
2. Font Dialog
3. Open file Dialog
4. Save file Dialog
5. Print Dialog
6. PrintPreviewDialog
7. PageSetupDialog

To use any Common Dialog Control just add that control to our form as give below
image.

When a Common dialog control is


added to a project, a new icon
appears in the components tray of
the form.

They do not place any specific


postion of the Form like other
controls are place.

To display Common dialog control at runtime we need to call .ShowDialog() method of


the dialog control.

Here we are going to view Common dialog controls with RichTextBox control. Right
now just guess that RichTextBox control is an advance version of the TextBox control.

.ShowDialog() method returns the value as given in below image:

Return type
of DialogBox

Usually we are writing the code if DialogBox return of Ok. Means when user press Ok
that time.
ColorDialog

Color Dialog allow us to select a color.

The image right side displays a color dialog.

User can select easily color from it.

We can get/set selected color value in Color property.

Properties of the ColorDialog controls are as given below:

AllowFullOpen True

➢ True or False.
False
➢ Default value is True.

➢ When set to False, the button of Define Custom Colors in the dialog box is
disabled and the user cannot define the custom colors.

Color

➢ Gets or sets the selected color value.

➢ Default color is black.

➢ If we set this property before opening the Color dialog box,the selected color will
display on the Color dialog box.

Example: Set color property runtime or design time.

Runtime(Coding)

Private Sub btnColorDg_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

With ColorDialog1

.Color = [Link]

Design Time
If .ShowDialog() = [Link] Then
[Link] = .Color

End If
End With

End Sub

Output:

FullOpen

➢ True or False

➢ Default value is False.

➢ If we want to give default color dialog with custom color then set value True for
the FullOpen property.

➢ If AllowFullOpen is false, then FullOpen has no effect.

Example: Set FullOpen property as True and see effect.

Private Sub btnColorDg_Click()

If [Link]() = [Link] Then Output


[Link] = [Link]
End If

End Sub
Example: Color Dialog usage

Private Sub btnBackColor_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

If [Link] = [Link] Then

[Link] = [Link]

End If

End Sub

Private Sub btnFontColor_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

If [Link] = [Link] Then

[Link] = [Link]

End If

End Sub
FontDialog

Font Dialog allow us to select a font size, face, style, etc.

AllowSimulations

ShowApply

MaxSize,MinSize

ShowEffect

ShowColor
AllowScriptChange

Some Properties of FontDialog

Keep in mind above image for understand below properties because all the properties
are related with area.

AllowSimulations

➢ True or False.

➢ Default value is True.

➢ See above image for AllowSimulations area.

AllowScriptChange

➢ True or False.

➢ Default value is True.

Properties
➢ Whether the user can change the character set specified in the Script.

Color

➢ True or False.

➢ Default value is False.

➢ It returns color selected by user.

➢ Default color is black.

Font

➢ Gets or sets Font

MaxSize , MinSize

➢ Starting and ending font size.

➢ Default values are 0 means, there are are no font size limits.

➢ Set

Output
ShowApply

➢ True or False

➢ Default value is False.

➢ If we wants to display ShowApply button then make it True.

ShowColor

➢ True or False

➢ The default value is False.

➢ Related with Color dialog combobox on FontDialog control.

ShowEffects

➢ Whether the dialog box contains controls that allow the user to specify
strikethrough, underline, and text color options.

➢ True or False.

➢ The default value is True.

If False
Example: On click of button open font dialog and apply effect.

Output
Private Sub btnFontDg_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]

With FontDialog1

If .ShowDialog = [Link] Then

[Link] = .Font

[Link] = .Color

End If

End With

End Sub
OpenFileDialog

It allows us to select a file to be opened.

Properties

Some Properties of the OpenFileDialog:

CheckFileExists

➢ Boolean value.

➢ The default value is True.

➢ Whether a warning message should be displayed if the user wants to open the
name of a file that does not exist.

FileName property

➢ Returns a string that contains the complete path and filename of the selected file
Private Sub btnFileOpen_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]

If [Link]() = [Link] Then

MsgBox([Link], [Link], "File")

End If

End Sub

Filter property

➢ Related with "Files of type" drop-down


listbox.

➢ It is commonly used in all the software.

➢ For example, in Winamp if we click on open


File then it will not display .doc,.exe,.txt,.xls
etc. File type.

➢ Same for Microsoft Word, Microsoft


Excel,etc. software they all are display
related extension files only.

➢ With the help of Filter property we can set


this concept in OpenFile dialog
control.

➢ Format of it like "User understand title|*.extension"

Exampled: Design time

Hai Text File title will display to user and filter the
files using *.txt

Output
Exmaple: Set filter property using coding and multiple filters.

Private Sub btnFileOpen_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = "Text Files|*.txt|Word file|*.doc|All files|*.*"

If [Link]() = [Link] Then

[Link]([Link], [Link])

End If

End Sub
Example: Using OpenFile dialog open Image in PicuteBox control

Click on Button

Output
Private Sub btnFileOpen_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]

[Link] = "GIF images|*.gif|JPG images|*.jpg|BMP


images|*.bmp"

If [Link]() = [Link] Then

[Link] = [Link]([Link])

End If

End Sub

FilterIndex property

➢ Which default Filter value will show to user? Each filter value has an index.

➢ By default index 1 is display.

Example:

If we write

[Link] = "GIF images|*.gif|JPG images|*.jpg|BMP images|*.bmp"

Then

GIF images|*.gif have index no 1.

JPG images|*.jpg have index no 2.

BMP images|*.bmp have index no 3.

And if we set [Link] = 2 then whenver we open the


OpenFileDialog it will display first JPG images in the Files of type list box.

InitialDirectory property

➢ Gets or sets a initially display directory of OpenFileDialog dialog

Example: Whenever user will click on Open C: will first display

With OpenFileDialog1

.InitialDirectory = "c:\"

If .ShowDialog() = [Link] Then


Logic…
End If

End With
ReadOnlyChecked

➢ Boolean value.

➢ Whether the read-only check box is selected on the dialog box.

ShowReadOnly

➢ Boolean value.

➢ Whether the dialog box contains a read-only checkbox.

Title property

➢ Gets or sets title of the OpenFile dialog box.

Example:

[Link] = "Hai Hello"

SaveFileDialog

Allow us to save the file in a specified location.

Basically it is SaveAs file dialog. The default title of SaveFile dialog box is Save As.

Properties of the Save File Dialog are the same as that of the Open File Dialog.

Examples: Save file using SaveFileDialog control.


Private Sub btnFileSave_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]

With SaveFileDialog1

.Filter = "Text files|*.txt"

If .ShowDialog = [Link] Then

[Link](.FileName, [Link])

End If

End With

End Sub
RichTextBox

➢ It's an advance version of TextBox.

➢ Difference between TextBox and RichTextBox is like Notepad and WordPad.

➢ It provides more advanced text formatting option.

➢ It can load RTF ,TXT format files for reading or editing.

➢ The wordpad save it’s file in RTF format. The full form of RTF is Rich Text Format.

➢ RichTextBox allows formatting the text, say adding colors, displaying particular
font types,selected text effect, bullets, alignment,indents and so on.

➢ By default RichTextBox is multiline.

➢ By default maxlength of it 2147483647.

➢ Some properties of RichTextBox are


BulletIndent,ZoomFactor,SelectionFont,SelectionColor ,Alignment, etc.

➢ Methods of RichTextBox are like


LoadFile,SaveFile,Cut,Copy,Paste,Undo,Redo,Replace, etc.

➢ We are going to create Notepad, during it we can learn the advance features of
RichTextBox.

Example: Create notepad with menus as given below:

File->New,Open,Save,SaveAs,Exit

Edit->Undo,Redo,Cut,Copy,Paste,SelectAll

Format->Font->Selected
->All
->Color->Selected
->All
->Alignment->Left
->Center
->Right
->Bullet

View->Zoom->5
->10

AboutMe
Private Sub NewToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]

'New file

If [Link] <> "Notepad" Then

[Link]([Link], [Link])

MsgBox("Your file is saved", [Link], "Notepad")

[Link] = "Notepad"

[Link]()

Else

End If

End Sub

Private Sub OpenToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

'Open

With OpenFileDialog1

.Filter = "Text file|*.txt|RTF file|*.rtf"

If .ShowDialog = [Link] Then

[Link](.FileName, [Link])
[Link] = .FileName

End If

End With

End Sub

Private Sub SaveToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

'Save

If [Link] = "Notepad" Then

With SaveFileDialog1

.Filter = "Text file|*.txt|RTF file|*.rtf"


.Title = "Save file"

If .ShowDialog = [Link] Then

[Link](.FileName, [Link])
[Link] = .FileName

End If

End With

Else

[Link]([Link], [Link])

MsgBox("Your file is saved", [Link], "Notepad")

End If

End Sub

Private Sub SaveAsToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

'Save As

With SaveFileDialog1

.Filter = "Text file|*.txt|RTF file|*.rtf"

If .ShowDialog = [Link] Then

[Link](.FileName, [Link])

[Link] = .FileName

End If

End With

End Sub

Private Sub ExitToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

End

End Sub

Private Sub UndoToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link]()

End Sub

Private Sub RedoToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link]()
End Sub

Private Sub CutToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link]()

End Sub

Private Sub CopyToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link]()

End Sub

Private Sub PasteToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link]()

End Sub

Private Sub SelectAllToolStripMenuItem_Click(ByVal sender As [Link], ByVal e


As [Link]) Handles [Link]

[Link]()

End Sub

Private Sub SelectedToolStripMenuItem_Click(ByVal sender As [Link], ByVal e


As [Link]) Handles [Link]

'Font->Selected

With FontDialog1

If .ShowDialog = [Link] Then

[Link] = .Font

End If

End With

End Sub

Private Sub AllToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

'Font->All

With FontDialog1

If .ShowDialog = [Link] Then


[Link] = .Font

End If

End With
End Sub

Private Sub SelectedToolStripMenuItem1_Click(ByVal sender As [Link], ByVal e


As [Link]) Handles [Link]

'Color->Selected

With ColorDialog1

If .ShowDialog = [Link] Then


[Link] = .Color
End If

End With

End Sub
Private Sub AllToolStripMenuItem1_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]

'Color->All

With ColorDialog1

If .ShowDialog = [Link] Then


[Link] = .Color
End If

End With

End Sub

Private Sub RightToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = [Link]

End Sub

Private Sub LeftToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = [Link]

End Sub

Private Sub CenterToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = [Link]

End Sub
Private Sub BulletToolStripMenuItem_Click(ByVal sender As [Link], ByVal e As
[Link]) Handles [Link]

[Link] = 2
[Link] = True

End Sub

Private Sub ToolStripMenuItem2_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = 2

End Sub

Private Sub ToolStripMenuItem3_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = 5

End Sub

Private Sub ToolStripMenuItem4_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = 10

End Sub

Private Sub AboutMeToolStripMenuItem_Click(ByVal sender As [Link], ByVal e


As [Link]) Handles [Link]

Dim frm As New frmDialog1


[Link]()

End Sub
TreeView

➢ It display a hierarchy of nodes both parent and child.

➢ Windows Explorer and Solution Explorer contains TreeView control.

➢ TreeView control is collection of nodes.

➢ The main starting node is called root node.

➢ Under the root, a real tree is made of branches and leaves.

➢ A node can have a node as a child.

➢ We can expand and collapse these nodes by clicking them.

➢ We can display TreeView control with check boxes next to the nodes, if the
TreeView's CheckBoxes property is set to true

Example: Drag and Drop Treeview control on form then click on Nodes property.
The ListBox and ComboBox control have Items property and we can add item in the
Items property same over here the TreeView control have Nodes property.

Properties of TreeView

Nodes collection

TreeView have nodes collection.

Properties of Nodes collection

Count – It returns total number of elements or say nodes in the TreeView.

Example: MsgBox([Link])

Items – It returns the nodes of the given index.

Example:

Private Sub btnAns_Click(ByVal sender As [Link], ByVal e


As [Link]) Handles [Link]

Dim node As New TreeNode

node = [Link](1)

MsgBox([Link])

End Sub

Methods of Nodes collection

Add() – It adds nodes in the TreeView.

Example:

[Link]("Mumbai")

Example:

With [Link]
.Add("Mumbai")
.Add("Noida")
.Add("Delhi")
.Add("Ahmedabad")
End With

Example:

Dim Item_name As String

Item_name = InputBox("Enter Item", "")

[Link](Item_name)

AddRange()- It adds nodes array

Example:

Dim strNodes(2) As TreeNode

strNodes(0) = New TreeNode("Juhu")


strNodes(1) = New TreeNode("Malad")
strNodes(2) = New TreeNode("Ghatkopar")

[Link](strNodes)

Clear() – It clears all the nodes from the TreeView.

Example: [Link]()

Contains()

It returns Boolean answer.

It checks whether the given node is a part of TreeView or not.

Example:

Dim node As New TreeNode


[Link] = "Nano"

If [Link](node) = True Then


MsgBox("Yes")
Else
MsgBox("False")
End If

Insert()

It contains 2 arguments. Index and Node.

We can insert node in the Treeview in any place by using Insert method.

Example:

Dim node As New TreeNode


[Link] = "Nano"

[Link](1, node)

Remove() – It removes the node from the Treeview. The argument of Remove()
method is the node.

Example: [Link](node)

RemoveAt() – It removes the node from the TreeView by index.

Example: [Link](0)

How can we identify the selected node and child node?

Selected Node

Private Sub btnSel_Click(ByVal sender As [Link],


ByVal e As [Link]) Handles [Link]

MsgBox([Link])

End Sub

Private Sub btnChi_Click(ByVal sender As [Link],


ByVal e As [Link]) Handles [Link]

MsgBox([Link](0).Text)
MsgBox([Link](1).Text)
MsgBox([Link](2).Text)

End Sub

Check this

MsgBox([Link])
MsgBox([Link])
MsgBox([Link])

In above image the sequence of the nodes as given below:

Node Identification
Ahmedabad [Link](0)
Mumbai [Link](1)
Gurukul [Link](0).Nodes(0)
DriveIn [Link](0).Nodes(1)
Bopal [Link](0).Nodes(2)
Kandivali [Link](1).Nodes(0)
Borivali [Link](1).Nodes(1)
Malad [Link](1).Nodes(2)
Example: Demo of Add, Remove,Clear,Expand,Collapse methods.

Private Sub btnAdd_Click(ByVal sender As [Link], ByVal e As [Link])


Handles [Link]

[Link]([Link])

End Sub

Private Sub btnChild_Click(ByVal sender As [Link],


ByVal e As [Link]) Handles [Link]
[Link]([Link])

End Sub

Private Sub btnRemove_Click(ByVal sender As


[Link], ByVal e As [Link]) Handles
[Link]

[Link]()

End Sub

Private Sub btnClear_Click(ByVal sender As [Link],


ByVal e As [Link]) Handles [Link]

[Link]()

End Sub

Private Sub btnCollapse_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link]()

End Sub

Private Sub btnExp_Click(ByVal sender As [Link], ByVal e As [Link])


Handles [Link]

[Link]()

End Sub

Private Sub btnCount_Click(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

MsgBox([Link])

End Sub

CheckBoxes

➢ True or False
➢ Display checkbox with TreeView’s node.

➢ Default value is False.

HotTracking

➢ True or False

➢ Default value is False.

➢ Nodes get hyperlink effect when the mouse is moved over them.

ShowLines

➢ True or False

➢ Default value is True.

➢ Whether the lines are displayed between nodes or


not.

ShowPlusMinus

➢ True or False

➢ Default value is True.

➢ Whether the Plus/Minus symbol displayed or not.

ShowRootLines

➢ True or False

➢ Default value is True.

➢ Whether the Rootlines are displayed between parent


/ child nodes or not.

FullPath

➢ It returns full path of the node.

Example:

MsgBox([Link])

BCA\GLS

PathSeparator

➢ The string delimeter used for path returnd by FullPath property.

➢ The default value is \.

Default event of the Tree View control is the AfterSelect event. It fires after the tree
node is selected.
TreeView control can work with ImageList control. The advantage of using the
ImageList is that we can treat the images as a collection. The ImageList control is used
to store images, which can display by other controls like ListView, TreeView, etc. To
work with ImageList follows the below given steps:

Step 1: Add ImageList control to our form.

Step 2: Go to Images property of ImageList control and add images in it.

Step 3: Select the name of ImageList control from TreeView control’s ImageList
property and set SelectedImageIndex property (Image for selected node).

Step 4: Now run the project and see the effect.


ListView

It’s an advanced ListBox.

It allows you to add rows of data, but it also supports large and small icons, multiple
columns, automatic label edit, column re-order, hot-tracking, and the four main modes
that you see in explorer:

1. Icon - Displays items with large icons and your main text
2. Small Icon - Displays items with small icons and your main text
3. List - Displays items with your main text
4. Detail - Displays items with small icons, your main text, and any other data to be
displayed in columns.

ListView have Items collection like ListBox.

We can add items at design time using Items [Link] it click on Items property.
Coding:

Private Sub frmListV_Load(ByVal sender As [Link], ByVal e As


[Link]) Handles [Link]

[Link] = [Link]

[Link]("Director", 40, [Link])


[Link]("Movie", 40, [Link])
[Link]("Review", 40, [Link])

[Link]("Yash C.")
[Link]("Sanjay B.")
[Link]("Rakesh R.")

[Link](0).[Link]("Lamhe")
[Link](0).[Link]("Good")

[Link](1).[Link]("Devdas")
[Link](1).[Link]("Ok")

[Link](2).[Link]("Krish")
[Link](2).[Link]("Good")

End Sub
Exercise-5

Q.1 Explain the following controls with its properties ,methods and events.

1. TrackBar
2. ScrollBar
3. ListBox
4. ComboBox
5. CheckedListBox
6. ScrollBar
7. TrackBar
8. RichTextBox
9. TreeView
10. ListView

Q.2 Answer the following:

1. Explain check State property of checkbox with its example.


2. Explain GropuBox and Panel.
3. Explain text manipulation and text selection properties of textbox.
4. Explain SelectedIndex and SelectedIndices properties of the ListBox.
5. Write down the formula of Scrollbar can scroll.
6. Explain all the Common dialog control.
7. Explain the use of PathSeparator and FullPath property of TreeView control.

Q.3 Compare

1. CheckBox and Radio Button


2. Valuechanged event and Scrollevent of ScrollBar
3. Groupbox and Panel
4. ComboBox and ListBox
5. TextBox and RichTextBox.

Q.4 Write down coding:

1. How can we count the total number items in the list?


2. Explain as possible ways add items in the list and remove items from the list.
3. add and insert method of Listbox
4. Give example selectionmode property of Listbox.
5. Give example of DropDownStyle of comboBox.
6. Explain the difference between getselected, setselcted and clearselected methods
of listbox.
7. Load file in the RichTextBox control.
8. Save file in the RichTextBox control.
9. Give example of Filter property of FontDialog.
10. Count total number of nodes in the TreeView control.

Q.5 Write down True or False.

1. We can have mutliline textbox with password.


2. The default size of textbox is 20000.
3. Bydefault we can select multiple items in the ListBox.
4. ComboBox have columns property.
5. The default dropdown style property set as simple.
6. By default Font dialog control display color selection area.
7. We can identify the selected node by node property.
8. We can not specify path of the selected node.

Q.6 Practical

TextBox

1. Create Login form and if username and password are right then open the MDI
form.

2. Create form as given below:

Trackbar

1. Depends on the trackbar position picture will display in the picture box.

2. There are 3 Track Bars on the Form. The first Track Bar is stands for Red, second
for Green and third for Blue, depends on the position of indicator the background
color of label is display on Mouse Move.

3. According to Track bar position display Table of It.

4. Compare two track bar’s value as per the value selected in both of them, you
have to display that which track bar is having the Maximum and which one is the
Minimum value.

5. Redefine program no.2 with the 2nd picture box.

6. Redefine program no.2 with 3 textboxes.

Scrollbar

1. Depends on the scrollbar position picture will display in the picture box.
2. There are 3 scrollbars on the Form. The first Scrollbar is stands for Red, second
for Green and third for Blue, depends on the position of indicator the background
color of label is display on Mouse Move.

3. According to scrollbar position display Table of It.

4. Redefine program no.8 with the 2nd picture box.

5. Redefine program no.2 with 3 textboxes.

6. Compare two scrollbar’s value as per the value selected in both of them, you
have to display that which scrollbar is having the Maximum and which one is the
Minimum value.

7. Print ABCD according to position.

Combo Box

1.

2.
3
ListBox

1. Listbox name is lstBox and righthand side listbox name is lstmode

2.
3.

CheckBoxList

[Link] only CheckedItem

2. Display items state whether checked or not

3. Find item by entering string if found then select it.


4. CheckBoxList name is chkLstMenu , ListBox name is lstSelected

5.

OnClick of Inbox button one Item must be add.


OnClick of Delete button first ask to user sure or not, if user press yes then selected
Items must be delete.
OnClick Read Button the selected item display in the messagebox(select only one item)
6.

Exercise 23:

Create an order form which contains checkboxelist for different item as above
also display their price in labels and allow user to enter quantity in textboxes
and on the click of ‘Bill’ print the total amount of bill.

Exercise 24:

Create notepad using RichTextBox and Common dialog control.

Exercise 25:

You might also like