0% found this document useful (0 votes)
19 views

Dot Net 2

Dot net notes

Uploaded by

Siddhi Sonawane
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)
19 views

Dot Net 2

Dot net notes

Uploaded by

Siddhi Sonawane
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
You are on page 1/ 8

Dot net 2

Q1. Features of VB.NET:


1. Following are the key features of VB.NET
2. Powerful Windows-based applications
3. Powerful, flexible, simplified Data Access
4. Improved coding
5. Direct Access to the platform
6. Full object-oriented constructs
7. XML Web Services
8. Mobile Applications

Q2. Operators In VB.net


• VB.Net provides many built-in operators that allow us to manipulate data An
operator performs a function on one or more operands. Available operators are
as bellow:
1. Arithmetic Operators
2. Comparison Operators
3. Logical/Bitwise Operators
4. Concatenation Operators
1. Arithmetic Operators:
Arithmetic Operators are used to perform operations that involve calculation of
Numeric Values
2.. Comparison Operators:
Comparison Operator compares Operands and returns a logical value based on
whether the comparison is true or not.

3.Logical/Bitwise Operators:
Logical Operators compare Boolean expression and return a Boolean result. These
Operators return a true or false result over a conditional expression.

4. Concatenation Operators:
Concatenation operators join multiple strings into a single string.
Q3. Data types in VB.net.

Q4. Data type conversion/Type casting


• A Process of converting a value of one datatype to another is called as conversion
or casting.
• Conversions are made in two ways:
1. Implicit Conversion
2. Explicit Conversion
1. Implicit Conversion:
• It converts data from a data type with a narrower range of possible values to a
data type with a wider range of possible values.
Module Modulel
Sub Main ()
Dim n1 As Integer-100
Dim n2 As Integer-75
Dim total As Long
Total=n1+n2
Console.WriteLine("Total is &total)
Console.ReadLine()
End Sub
End Module
2. Explicit Conversion:
• It converts data from a wider range data type to a narrower range data type.
• In this conversion CLR checks for data compatibility at runtime.
• Explicit conversion requires explicitly calling a conversion function.
Module Module1
Sub Main ()
Dim num As Integer
Dim mark As Decimal-34.75
num=CInt(mark)
Console.WriteLine("Converted value is:" &num)
Console.ReadLine()
End Sub
End Module

Q4. Controls in VB.NET


1 Windows Forms:
• VB.NET support for windows forms is in the System.
• Windows.Forms namespace and the form class is System.Windows.Forms.form
• The form class itself is based on the control class, which means that forms share a
lot of the methods and properties that controls do.
• Form is a kind of control which acts as another control holder which is available in
the Visual Basic Integrated Development Environment (IDE) which shows several
aspects of form.
• Form properties.
1. Back colour: it is used to set background colour for the form
2. Background image: it is used to set background image of the form
3. Font: it is used to get or set the font used in form
4. Name: it is used to define the name of the form
5. Autoscroll: it allows weather to enable auto scrolling in form
• Form event
1. Activated: an activated event is found when the user or program activates the
form clicked
2. Click: click event is active when the form is
3. Closed: closed event is found before closing the form
4. Doubleclick: it is activated when the users double click on the form
• Form methods:
1. Activate: activate the form and give it focus
2. Close: closes the form
3. Hide: hide the control from the user
4. Select: activate the control

Q5. Text box control


• TextBox Control:
• This control is used to accept input from user or to display text.
• Textboxes can display multiple lines wrap text to the size of control.
• The TextBox is based on the TextBoxBase class which is based on the Control
class.
• By default, user can enter up to 2048 characters in a TextBox but if the multilin
property is set to True user can enter up to 32KB of text.
• Text box properties
1. Text: used to set the text for the text box
2. Backcolour: set the background colour of the text
3. Enabled: to disable the text box default values true
Q6. Button control
• A Button is a window control used to initiate an Action.
• From the user's standpoint, a Button is useful when clicked, in which case the
user positions the mouse on it and passes one of the mouse buttons.
• When the Button is clicked, it looks as if it is being pushed in and release,
whenever
• the user clicks a button, the click event handler is invoked.
• The Button Class is based on the ButtonBase class which is based on the control
class.
• Button properties
1. Image: the image displayed on the control
2. Image align: Images displayed in the label
3. Text aline: aline text displayed in the control

Q7. Label Control:Introduction


• Label control is used to display text on the client area of form such as title,
paragraph or captions for other control.
• The text displayed by a label control is a text which is set to its text property.
• Property
1. BackgorundImage:The background image displayed on the label.
2. BorderStyle: Sets the border style for the label.
3. FlatStyle: Sets the flat style appearance of the label.
4. Image:The image displayed on the label.
5. ImageAlign:Align image displayed in the label.

Q7.CheckBox Control:
• CheckBox is a small square box that the user can click for an option to select
YES/NO or True/False.
• A CheckBox is clicked to select and clicked again to deselect some option,
checkbox control is based on textboxbase class which is based on the Control
class.
Q8. RadioButton Control:
• A radio button is also called an option button which is a circular control, used to
select and deselect options.
• A major difference between checkboxes and radio buttons is user can select only
one radio button at a time while in case of checkboxes user can select multiple
checkboxes at a time.
• The RadioButtons are mostly used together in group.

Q9.PictureBox Control:
• The PictureBox control allows user to set a picture in it.
• Size Mode is one of the important properties of PictureBox.
• User can set the image as Normal, StretchImage, AutoSize, CenterImage and
Zoom.

Q10. ImageList Control:


• The ImageList is a simple control that stores images used by other controls a
runtime.
• For example, a TreeView control can use icons to identify its nodes
• The simplest method of preparing these images is to create an ImageList control
and add to it all the icons you need. The ImageList control maintains a series of
bitmaps memory that the TreeView control can access quickly at runtime. Keep in
mind the ImageList control can't be used on its own and remains invisible at
runtime

Q11. DataGridView:
• DataGridView provides a visual interface to data, it is an excellent way to display
and allow editing of users data.
• It is accessed with VB.NET code. Data edited in the DataGridView can then be
persisted in the database.
• The DataGridView control is basically made of rows and columns.
Q22. Creating Menus and Submenus
• Simplest way to create menus in VB.NET is at design time because the MainMenu
control is available in toolbox.
• To create a new menu, double_click text to open a text box where in that text
box we can enter caption for menus and menu item.

Q23. DialogBox
1. InputBox ()
• InputBox is used to prompt the user to enter the values.
• A text can be return in the text box by using the InputBox function if the user
clicks on the OK or Enter button. And if the user clicks on the Cancel button, then
the InputBox function will return an empty string ("").
2. MessageBox()
• A Class called as MessageBox because it is introduced by VB.NET which
encapsulates all the features of MsgBox.
• The difference between MessageBox and MsgBox is that MsgBox is a function
while MessageBox is a Class.
• The MessageBox class has overloaded method show () to display message on
prompt.

You might also like