Q 1. What is NESTED Class ? 

Ans. A class that can be declared within the scope of another class. These classes are considered within the scope of the enclosed class and are available within that class or scope.


Q 2. What do you mean by Projects ? Explain types of project in .NET ?

Typically, projects are files, for example, a .csproj file for a Visual C# project, that store references to source code files and resources like bitmap files. Projects let you organize, build, debug, and deploy source code, references to Web services and databases, and other resources.

Visual Studio comes with many project templates to create the necessary code and files to start developing applications. Details on few common project types are listed as

Project TypeDescription
Class libraryComponent library with no user interface
Console applicationCommand line application
Database projectSQL script storage
Device applicationWindows application for a smart device
Empty projectBlank project
SQL Server projectManagement of stored procedures and SQL Server objects
Web serviceASP.NET Web application with no user interface; technically, no longer a project type
Web siteASP.NET Web application; technically, no longer a project type
WindowsWindows application with a user interface application
Windows serviceWindows application with no user interface
WPF Browser ApplicationWindows Presentation Foundation browser application

Visual Studio has templates pre-defined for most of programmer’s needs but custom project templates can also be developed by user for genearting some default content to use. Customizing involves the following steps

  • Creating or modifying a VSDIR file
  • Creating a VSZ file
  • Customizing the default javascripts
  • Creating your file templates



Q 3.Explain the IDE of VB.Net with all bar and Windows.

Ans. The full name of IDE is an integrated development environment. It is a software application that allows developers to develop, run, test and debug software.

Generally, IDE consists of a code editor, a compiler, or an integrator and a debugger.

IDE has more features such as through this we can store the code online, format the code and optimize the code and it has a lot of plugins and extensions which is very helpful in creating a rich application.

The IDE's toolbar looks like a word processor. This is called IDE because we can access the necessary tools to develop the software application.
IDE components
The components of the IDE are as follows: -

1- IDE project window 

We call the window title project-project1 as project explorer and it contains the project file. We usually call the project explorer window.

The toolbar of the project explorer contains three buttons named view code, view object and toggle folders.

When we press the view code button, a window is displayed to write the visual basic code in it.

When we press the view object button, it displays a form.

The toggle folders are what hide or show the forms folder.

2- Toolbar

It provides quick access to most commonly used commands while programming, that is, we can quickly access such commands which are used most often.

We can perform a task related to it by clicking a button in the toolbar. We can change the settings of the toolbar from the View menu.

3- Form designer:- For a software application, form objects are like building blocks. This is the window from which the user interacts at the beginning of the application. Forms have their own properties, events, and methods that we can control. The form window is a window where we draw our application.

4- Toolbox (toolbox):- The toolbox is a very large box with many different icons in it. This is the selection menu for controls. These controls are used to customize forms.

What controls are prepackaged components that can be used again? Through which we can write programs quickly.

Some of its controls are as follows:-

PictureBox - This control displays the image.
label- This control displays uneditable text to the user. the uneditable text means text that cannot be edited.
textBox - This control is to accept user input.
commandButton - This displays the control button.
Listbox - It provides a list of control items
comboBox - This control provides a shortlist of items.

Read: What is BackLink and how to create Quality Backlink For SEO?

5- Property window

The property window which displays properties for forms or controls is properties attributes like size, position, etc.

Like form, control also has its own unique properties. Some properties like width and height are similar in both, but apart from this other properties are different.

6- Menu bar:- menu bar displays the commands that are required to create applications. It is a horizontal strip that appears on top of the screen and it contains the names of menus.

IDE menu bar 

file- It contains options to open, close, print, etc. of the project.

edit- It contains the options of cut, paste, undo, delete, find, etc.

view- This IDE displays the options to display Windows and toolbar.

project- It displays the options to add features to the project.

format- It contains the options to align and lock the control of the form.

debug - This includes debugging options.

run- It contains options to execute, stop the program.

diagram- It contains options to edit and view the design of the database.

tools– It contains options for IDE tools.

Add-ins- It contains the options to use, install, remove add-ins.

windows- It contains options to arrange and display the windows.

help- It contains options for taking the help.

7- form layout window

IDE form layout window:- The form layout window shows where your form will be displayed on the monitor screen.





Q 4. What is Form? How it is useful?

Ans. A Form is used in VB.NET to create a form-based or window-based application. Using the form, we can build a attractive user interface. It is like a container for holding different control that allows the user to interact with an application. The controls are an object in a form such as buttons
, Textboxes, Textarea
, labels
, etc. to perform some action. However, we can add any control to the runtime by creating an instance of it.

A Form uses a System.Windows.Form namespace, and it has a wide family of controls that add both forms and functions in a Window-based user interface.

How it is Useful :-
Forms essentially provide the windows that make up a Windows application. In fact, the terms window and form are often used interchangeably. Forms allow the Visual Basic developer to create windows and layout controls (such as buttons, labels etc) in those forms to provide the application's user interface.



Q 5.Explain all Looping Statements in VB.Net With Example

Ans. Loop statements in programs are used to execute a block of program codes multiple times. Loop statements allow us to run a set of program codes which are written inside the loop for multiple times. The codes written inside the loop block are executed while only the given condition is true and the loop automatically ends when the condition false. VB.Net supports several types of loop statements and loop control statements.

VB.Net supports the following Loop statements:
1. Do Loop
2. For Next
3. For Each Next
4. While End While
5. With End With
6. Nested Loop

VB.Net also supports some controls statements. Typically the statements inside the loop will execute one by one; control statements change execution from this typical sequence.

The control statements in VB.Net are given below:
1. Exit Statement
2. Continue Statement
3. GoTo Statement


1. Do Loop
The Do Loop repeats the group of statements while or until the given boolean condition is true. The Do Loop statements are terminated by the Exit Do statement.

There are two methods of Do Loop. The first method is entry loop and the second method is exit do loop. In entry do loop the boolean condition is checks first, and the exit Do-loop checks the boolean condition after the execution of loop statements

2. For…Next Loop
The for loops repeats a block of statements for a specified number of times. Here the loop also counts the number of the loop executions during every loop execution.

3. For Each…Next Loop
The For Each…Next is an another looping statement which repeats the block of statements for every element in the given group of items. This Loop statement is used in VB.Net for the manipulation of an array of elements.

4. While… End While Loop
The While… End While loop executes the set of following statements while the given condition is true. The statements of while loop are enclosed within While and End While
statements.

5. With… End With
The With… End With is not a looping statement, but it also counts as a looping statement. This is called a loop statement because it executes a series statements multiple times by referring to a single object or structure.

6. NESTING OF LOOPS
The using of one loop statement in another loop statement is known as Nesting of Loops. The nested loop statements allow us to create more complex programs.

The three loop statements support in VB.Net are nested For Loop, nested While Loop and nested Do…While Loop




Q 6.Explain Server Explorer with Suitable example

Ans. The Server Explorer is a shortcut to accessing servers, either installed on the system, or connected to the system. These servers are usually database servers such as SQL Server. By accessing the server, you access all the databases on the specific server, and then you can build the connections needed inside your program, for your program. You also can get access to SharePoint servers.

Server Explorer allows you to graphically create databases, tables, views, and stored procedures completely from within Visual Studio .NET. You can also edit and delete existing database objects.




Q 7.Explain all data Various types in VB.Net.

Ans. Data types determine the type of data that any variable can store. Variables belonging to different data types are allocated different amounts of space in the memory. There are various data types in VB.NET. They include:


  • Boolean: the allocated storage depends on the platform of implementation. Its value can be either True or False.

  • Byte: allocated storage space of 1 byte. Values range from 0 to 255 (unsigned).

  • Char: allocated a space of 2 bytes. Values range from 0 to 65535 (unsigned).

  • Date: allocated storage space of 8 bytes. Values range from 0:00:00 (midnight) January 1, 0001 to 11:59:59 PM of December 31, 9999.

  • Integer: has a storage space of 4 bytes. Values range between -2,147,483,648 to 2,147,483,647 (signed).

  • Long: has a storage space of 8 bytes. Numbers range from -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807(signed).

  • String: The storage space allocated depends on the platform of implementation. Values range from 0 to about 2 billion Unicode characters.




Q 8.What is MSIL ? Why it is Used ? Also Explain CTS in .Net.

Ans. MSIL stands for Microsoft Intermediate Language. Microsoft Intermediate Language (MSIL) includes instructions for loading, storing, initializing, and calling methods on objects, as well as instructions for arithmetic and logical operations, control flow, direct memory access, exception handling, and other operations. Just In Time Compiler

CTS - Common Type System (CTS) is a standard that specifies how type definitions and specific values of types are represented in computer memory. It is intended to allow programs written in different programming languages to easily share information.




Q 9.What is Function ? How they are defined in VB.Net and Explain argument passing machanism.

Ans. The function is a separate group of codes that are used to perform a specific task when the defined function is called in a program. ... For example, if we need to use the same functionality at multiple places in a program, we can simply create a function and call it whenever required.

Where,

  • Modifiers − specify the access level of the function; possible values are: Public, Private, Protected, Friend, Protected Friend and information regarding overloading, overriding, sharing, and shadowing.

  • FunctionName − indicates the name of the function

  • ParameterList − specifies the list of the parameters

  • ReturnType − specifies the data type of the variable the function returns



Passing Arguments


In Visual Basic, you can pass an argument to a procedure by value or by reference. This is known as the passing mechanism, and it determines whether the procedure can modify the programming element underlying the argument in the calling code. The procedure declaration determines the passing mechanism for each parameter by specifying the ByVal or ByRef keyword.

Distinctions

When passing an argument to a procedure, be aware of several different distinctions that interact with each other:

  • Whether the underlying programming element is modifiable or nonmodifiable

  • Whether the argument itself is modifiable or nonmodifiable

  • Whether the argument is being passed by value or by reference

  • Whether the argument data type is a value type or a reference type


Choice of Passing Mechanism

You should choose the passing mechanism carefully for each argument.

  • Protection. In choosing between the two passing mechanisms, the most important criterion is the exposure of calling variables to change. The advantage of passing an argument ByRef is that the procedure can return a value to the calling code through that argument. The advantage of passing an argument ByVal is that it protects a variable from being changed by the procedure.

  • Performance. Although the passing mechanism can affect the performance of your code, the difference is usually insignificant. One exception to this is a value type passed ByVal. In this case, Visual Basic copies the entire data contents of the argument. Therefore, for a large value type such as a structure, it can be more efficient to pass it ByRef.

    For reference types, only the pointer to the data is copied (four bytes on 32-bit platforms, eight bytes on 64-bit platforms). Therefore, you can pass arguments of type String or Object by value without harming performance.


Determination of the Passing Mechanism

The procedure declaration specifies the passing mechanism for each parameter. The calling code can't override a ByVal mechanism.

If a parameter is declared with ByRef, the calling code can force the mechanism to ByVal by enclosing the argument name in parentheses in the call. For more information, see How to: Force an Argument to Be Passed by Value.

The default in Visual Basic is to pass arguments by value.


When to Pass an Argument by Value

  • If the calling code element underlying the argument is a nonmodifiable element, declare the corresponding parameter ByVal. No code can change the value of a nonmodifiable element.

  • If the underlying element is modifiable, but you do not want the procedure to be able to change its value, declare the parameter ByVal. Only the calling code can change the value of a modifiable element passed by value.

When to Pass an Argument by Reference

  • If the procedure has a genuine need to change the underlying element in the calling code, declare the corresponding parameter ByRef.

  • If the correct execution of the code depends on the procedure changing the underlying element in the calling code, declare the parameter ByRef. If you pass it by value, or if the calling code overrides the ByRef passing mechanism by enclosing the argument in parentheses, the procedure call might produce unexpected results.



Q 10.Explain the Concept of 1D & 2D Array in VB.Net. With Example.

Ans. 1D array or single dimensional array stores a list of variables of the same data type. It is possible to access each variable using the index.

\


2D array or multi-dimensional array stores data in a format consisting of rows and columns.



Difference Between 1D and 2D Array

Definition         

A 1D array is a simple data structure that stores a collection of similar type data in a contiguous block of memory while the 2D array is a type of array that stores multiple data elements of the same type in matrix or table like format with a number of rows and columns. Thus, this is the main difference between 1D and 2D array.

Synonyms

A 1D array is also called single dimensional array while the 2D array is called multi-dimensional array.





Q 11.What is the difference between Namespace and Assembly?

Ans. 

Difference between NameSpace and Assembly

Namespace and Assembly ?

A .Net Namespace provides the fundamental unit of logical code grouping while an assembly provides a fundamental unit of physical code grouping.

Namespace

Namespaces is a logical group of related classes that can be used by any other language targeting the Microsoft .Net framework.



Q 12.What is an assembly and its use? What is strong name in .NET assembly? What are the different types of assembly?

Ans. An assembly is a collection of types and resources that are built to work together and form a logical unit of functionality. Assemblies take the form of executable (.exe) or dynamic link library (. dll) files, and are the building blocks of . NET applications.


A strong name consists of the assembly's identity—its simple text name, version number, and culture information (if provided)—plus a public key and a digital signature. It is generated from an assembly file using the corresponding private key.





Q 13. Explain the Concept of Common type System. in .NET

Ans. In Microsoft's . NET Framework, the Common Type System (CTS) is a standard that specifies how type definitions and specific values of types are represented in computer memory. It is intended to allow programs written in different programming languages to easily share information




Q 14. What do you mean by Connection string. Explain all its parameters with its Example.

Ans. Connection String is a normal String representation which contains Database connection information to establish the connection between Datbase and the Application. The Connection String includes parameters such as the name of the driver, Server name and Database name , as well as security information such as user name and password. Data providers use a connection string containing a collection of parameters to establish the connection with the database.

The .NET Framework provides mainly three data providers: Microsoft SQL Server, OLEDB and ODBC.


Basic connection

ParameterDescriptionDefault
HostSpecifies the host name - and optionally port - on which PostgreSQL is running. Multiple hosts may be specified, see the docs for more info. If the value begins with a slash, it is used as the directory for the Unix-domain socket (specifying a Port is still required).Required
PortThe TCP port of the PostgreSQL server.5432
DatabaseThe PostgreSQL database to connect to.Same as Username
UsernameThe username to connect with. Not required if using IntegratedSecurity.PGUSER
PasswordThe password to connect with. Not required if using IntegratedSecurity.PGPASSWORD
PassfilePath to a PostgreSQL password file (PGPASSFILE), from which the password is taken.PGPASSFILE



Q. 15 What is data grid view ?

The DataGridView control provides a customizable table for displaying data. The DataGridView class allows customization of cells, rows, columns, and borders through the use of properties such as DefaultCellStyle, ColumnHeadersDefaultCellStyle, CellBorderStyle, and GridColor




Q. 16 Explain the concept of cts.

In Microsoft's . NET Framework, the Common Type System (CTS) is a standard that specifies how type definitions and specific values of types are represented in computer memory. It is intended to allow programs written in different programming languages to easily share information.


Q. 17 How many procedures are in .net
procedure is a block of Visual Basic statements enclosed by a declaration statement (FunctionSubOperatorGetSet) and a matching End declaration. All executable statements in Visual Basic must be within some procedure.

Types of Procedures

Visual Basic uses several types of procedures:

  • Sub Procedures perform actions but do not return a value to the calling code.

  • Event-handling procedures are Sub procedures that execute in response to an event raised by user action or by an occurrence in a program.

  • Function Procedures return a value to the calling code. They can perform other actions before returning.

    Some functions written in C# return a reference return value. Function callers can modify the return value, and this modification is reflected in the state of the called object. Starting with Visual Basic 2017, Visual Basic code can consume reference return values, although it cannot return a value by reference. For more information, see Reference return values.

  • Property Procedures return and assign values of properties on objects or modules.

  • Operator Procedures define the behavior of a standard operator when one or both of the operands is a newly-defined class or structure.

  • Generic Procedures in Visual Basic define one or more type parameters in addition to their normal parameters, so the calling code can pass specific data types each time it makes a call.





Q. 18 Write the use of explicit keyword

To tell the compiler that a certain constructor may not be used to implicitly cast an expression to its class type.

The explicit keyword is an optional decoration for constructors that take exactly one argument. It only applies to single-argument constructors since those are the only constructors that can be used in type casting.



Q. 19 what do you mean by docking in vb.net.

Docking refers to how much space you want the control to take up on the form. If you dock a control to the left of the form, it will stretch itself to the height of the form, but its width will stay the same.

Q. 20 Discuss following with properties and events 
List box , tree view , scroll bar , picture box
Ans. 
  1. ListBox - The ListBox represents a Windows control to display a list of items to a user. A user can select an item from the list. It allows the programmer to add items at design time by using the properties window or at the runtime.

    Properties of the ListBox Control

    The following are some of the commonly used properties of the ListBox control −

    Sr.No.Property & Description
    1

    AllowSelection

    Gets a value indicating whether the ListBox currently enables selection of list items.

    2

    BorderStyle

    Gets or sets the type of border drawn around the list box.

    3

    ColumnWidth

    Gets of sets the width of columns in a multicolumn list box.

    4

    HorizontalExtent

    Gets or sets the horizontal scrolling area of a list box.

    5

    HorizontalScrollBar

    Gets or sets the value indicating whether a horizontal scrollbar is displayed in the list box.

    6

    ItemHeight

    Gets or sets the height of an item in the list box.

    7

    Items

    Gets the items of the list box.

    8

    MultiColumn

    Gets or sets a value indicating whether the list box supports multiple columns.

    9

    ScrollAlwaysVisible

    Gets or sets a value indicating whether the vertical scroll bar is shown at all times.

    10

    SelectedIndex

    Gets or sets the zero-based index of the currently selected item in a list box.

    11

    SelectedIndices

    Gets a collection that contains the zero-based indexes of all currently selected items in the list box.

    12

    SelectedItem

    Gets or sets the currently selected item in the list box.

    13

    SelectedItems

    Gets a collection containing the currently selected items in the list box.

    14

    SelectedValue

    Gets or sets the value of the member property specified by the ValueMember property.

    15

    SelectionMode

    Gets or sets the method in which items are selected in the list box. This property has values −

    • None
    • One
    • MultiSimple
    • MultiExtended

    16

    Sorted

    Gets or sets a value indicating whether the items in the list box are sorted alphabetically.

    17

    Text

    Gets or searches for the text of the currently selected item in the list box.

    18

    TopIndex

    Gets or sets the index of the first visible item of a list box.


Events of the ListBox Control

The following are some of the commonly used events of the ListBox control −

Sr.No.Event & Description
1

Click

Occurs when a list box is selected.

2

SelectedIndexChanged

Occurs when the SelectedIndex property of a list box is changed.



   2.Treeview The TreeView control is used to display hierarchical representations of items similar to the ways the files and folders are displayed in the left pane of the Windows Explorer. Each node may contain one or more child nodes.

Properties of the TreeView Control

The following are some of the commonly used properties of the TreeView control −

Sr.No.Property & Description
1

BackColor

Gets or sets the background color for the control.

2

BackgroundImage

Gets or set the background image for the TreeView control.

3

BackgroundImageLayout

Gets or sets the layout of the background image for the TreeView control.

4

BorderStyle

Gets or sets the border style of the tree view control.

5

CheckBoxes

Gets or sets a value indicating whether check boxes are displayed next to the tree nodes in the tree view control.

6

DataBindings

Gets the data bindings for the control.

7

Font

Gets or sets the font of the text displayed by the control.

8

FontHeight

Gets or sets the height of the font of the control.

9

ForeColor

The current foreground color for this control, which is the color the control uses to draw its text.

10

ItemHeight

Gets or sets the height of each tree node in the tree view control.

11

Nodes

Gets the collection of tree nodes that are assigned to the tree view control.

12

PathSeparator

Gets or sets the delimiter string that the tree node path uses.

13

RightToLeftLayout

Gets or sets a value that indicates whether the TreeView should be laid out from right-to-left.

14

Scrollable

Gets or sets a value indicating whether the tree view control displays scroll bars when they are needed.

15

SelectedImageIndex

Gets or sets the image list index value of the image that is displayed when a tree node is selected.

16

SelectedImageKey

Gets or sets the key of the default image shown when a TreeNode is in a selected state.

17

SelectedNode

Gets or sets the tree node that is currently selected in the tree view control.

18

ShowLines

Gets or sets a value indicating whether lines are drawn between tree nodes in the tree view control.

19

ShowNodeToolTips

Gets or sets a value indicating ToolTips are shown when the mouse pointer hovers over a TreeNode.

20

ShowPlusMinus

Gets or sets a value indicating whether plus-sign (+) and minus-sign (-) buttons are displayed next to tree nodes that contain child tree nodes.

21

ShowRootLines

Gets or sets a value indicating whether lines are drawn between the tree nodes that are at the root of the tree view.

22

Sorted

Gets or sets a value indicating whether the tree nodes in the tree view are sorted.

23

StateImageList

Gets or sets the image list that is used to indicate the state of the TreeView and its nodes.

24

Text

Gets or sets the text of the TreeView.

25

TopNode

Gets or sets the first fully-visible tree node in the tree view control.

26

TreeViewNodeSorter

Gets or sets the implementation of IComparer to perform a custom sort of the TreeView nodes.

27

VisibleCount

Gets the number of tree nodes that can be fully visible in the tree view control.


Events of the TreeView Control

The following are some of the commonly used events of the TreeView control −

Sr.No.Event & Description
1

AfterCheck

Occurs after the tree node check box is checked.

2

AfterCollapse

Occurs after the tree node is collapsed.

3

AfterExpand

Occurs after the tree node is expanded.

4

AfterSelect

Occurs after the tree node is selected.

5

BeforeCheck

Occurs before the tree node check box is checked.

6

BeforeCollapse

Occurs before the tree node is collapsed.

7

BeforeExpand

Occurs before the tree node is expanded.

8

BeforeLabelEdit

Occurs before the tree node label text is edited.

9

BeforeSelect

Occurs before the tree node is selected.

10

ItemDrag

Occurs when the user begins dragging a node.

11

NodeMouseClick

Occurs when the user clicks a TreeNode with the mouse.

12

NodeMouseDoubleClick

Occurs when the user double-clicks a TreeNode with the mouse.

13

NodeMouseHover

Occurs when the mouse hovers over a TreeNode.

14

PaddingChanged

Occurs when the value of the Padding property changes.

15

Paint

Occurs when the TreeView is drawn.

16

RightToLeftLayoutChanged

Occurs when the value of the RightToLeftLayout property changes.

17

TextChanged

Occurs when the Text property changes.




    3. ScrollBar The ScrollBar controls display vertical and horizontal scroll bars on the form. This is used for navigating through large amount of information. There are two types of scroll bar controls: HScrollBar for horizontal scroll bars and VScrollBar for vertical scroll bars. These are used independently from each other.

Properties of the ScrollBar Control

The following are some of the commonly used properties of the ScrollBar control −

Sr.No.Property & Description
1

AutoSize

Gets or sets a value indicating whether the ScrollBar is automatically resized to fit its contents.

2

BackColor

Gets or sets the background color for the control.

3

ForeColor

Gets or sets the foreground color of the scroll bar control.

4

ImeMode

Gets or sets the Input Method Editor (IME) mode supported by this control.

5

LargeChange

Gets or sets a value to be added to or subtracted from the Value property when the scroll box is moved a large distance.

6

Maximum

Gets or sets the upper limit of values of the scrollable range.

7

Minimum

Gets or sets the lower limit of values of the scrollable range.

8

SmallChange

Gets or sets the value to be added to or subtracted from the Value property when the scroll box is moved a small distance.

9

Value

Gets or sets a numeric value that represents the current position of the scroll box on the scroll bar control.



Events of the ScrollBar Control

The following are some of the commonly used events of the ScrollBar control −

Sr.No.Event & Description
1

Click

Occurs when the control is clicked.

2

DoubleClick

Occurs when the user double-clicks the control.

3

Scroll

Occurs when the control is moved.

4

ValueChanged

Occurs when the Value property changes, either by handling the Scroll event or programmatically.




    4. PictureBox The PictureBox control is used for displaying images on the form. The Image property of the control allows you to set an image both at design time or at run time.

Properties of the PictureBox Control

The following are some of the commonly used properties of the PictureBox control −

Sr.No.Property & Description
1

AllowDrop

Specifies whether the picture box accepts data that a user drags on it.

2

ErrorImage

Gets or specifies an image to be displayed when an error occurs during the image-loading process or if the image load is cancelled.

3

Image

Gets or sets the image that is displayed in the control.

4

ImageLocation

Gets or sets the path or the URL for the image displayed in the control.

5

InitialImage

Gets or sets the image displayed in the control when the main image is loaded.

6

SizeMode

Determines the size of the image to be displayed in the control. This property takes its value from the PictureBoxSizeMode enumeration, which has values −

  • Normal − the upper left corner of the image is placed at upper left part of the picture box

  • StrechImage − allows stretching of the image

  • AutoSize − allows resizing the picture box to the size of the image

  • CenterImage − allows centering the image in the picture box

  • Zoom − allows increasing or decreasing the image size to maintain the size ratio.

7

TabIndex

Gets or sets the tab index value.

8

TabStop

Specifies whether the user will be able to focus on the picture box by using the TAB key.

9

Text

Gets or sets the text for the picture box.

10

WaitOnLoad

Specifies whether or not an image is loaded synchronously.



Events of the PictureBox Control

The following are some of the commonly used events of the PictureBox control −

Sr.No.Event & Description
1

CausesValidationChanged

Overrides the Control.CausesValidationChanged property.

2

Click

Occurs when the control is clicked.

3

Enter

Overrides the Control.Enter property.

4

FontChanged

Occurs when the value of the Font property changes.

5

ForeColorChanged

Occurs when the value of the ForeColor property changes.

6

KeyDown

Occurs when a key is pressed when the control has focus.

7

KeyPress

Occurs when a key is pressed when the control has focus.

8

KeyUp

Occurs when a key is released when the control has focus.

9

Leave

Occurs when input focus leaves the PictureBox.

10

LoadCompleted

Occurs when the asynchronous image-load operation is completed, been canceled, or raised an exception.

11

LoadProgressChanged

Occurs when the progress of an asynchronous image-loading operation has changed.

12

Resize

Occurs when the control is resized.

13

RightToLeftChanged

Occurs when the value of the RightToLeft property changes.

14

SizeChanged

Occurs when the Size property value changes.

15

SizeModeChanged

Occurs when SizeMode changes.

16

TabIndexChanged

Occurs when the value of the TabIndex property changes.

17

TabStopChanged

Occurs when the value of the TabStop property changes.

18

TextChanged

Occurs when the value of the Text property changes.






Q. 21 Write a program to add delete search items in comboBox

The combobox control helps you to display a drop-down list with many items. See it as a combination of a textbox in which a user enters text and a dropdown list from which a user selects an item. Note that the combobox shows one item at a time. 


Adding Items to Combobox

Now that we have created a combobox, let us demonstrate how to add items to it.

Double click the combobox control that you have added. You will be moved from the design tab to the tab with code.

To add an item to a combobox control, we use the Items property. Let us demonstrate this by adding two items to the combobox, Male and Female:

ComboBox1.Items.Add("Male")
ComboBox1.Items.Add("Female")

We can also choose to add items to the combobox at design time from the Properties window. 


Program -

'Add items

ComboBox1.Items.Add(text)


'remove items

ComboBox1.Items.Remove(ComboBox1.SelectedItem)


Here are the steps:


Step 1) Open the design tab and click the combobox control.

Step 2) Move to the Properties window and view the Items option.

Step 3) Click the … located to the right of (Collection).

Step 4)You will see a new window. This is where you should add items to the combobox.

Step 5) Once done with typing the items, click the OK button.

Step 6) Click the Start button from the top toolbar and click the dropdown icon on the combobox.


The items were successfully added to the combobox control.






Q. 22 What is the size of variant data types

The Variant data type has a numeric storage size of 16 bytes and can contain data up to the range of a Decimal, or a character storage size of 22 bytes (plus string length),and can store any character text.



Q. 23 Difference between data set and data reader

The DataSet class in ADO.Net operates in an entirely disconnected nature, while DataReader is a connection oriented service.
Dataset is used to hold tables with data. ... DataReader is designed to retrieve a read-only, forward-only stream of data from data sources.
DataReader has a connection oriented nature, whenever you want fetch the data from database that you must have a connection.