VB Day 7

You might also like

Download as ppt, pdf, or txt
Download as ppt, pdf, or txt
You are on page 1of 11

Windows Applications

 To achieve .net provides a base class


library called as
system.windows.Forms.dll
 Control: It is a user interface element
which is used for providing interaction
between the user and the application.
This control is also a class.
Control [class]

Properties Methods Events

 Property : it is used to set or get the values


from a private or protected members of the
control.
 Methods: these are predefined instructions
which are supported by the control.
 Events: these are actions which are allowed
on a control.

Note: in order to provide the definitions for


the events,event handlers are used
Form
 Form :- It acts like a canvas or a parent
control which maintains all other controls
required for user interaction.
 Properties:
1] Accept Button – Gets or sets the button
on the form that is pressed when the user
uses the Enter key.
2] Cancel Button – Indicates the button
control that is pressed when the user
presses the ESC key.
 3] Opacity – Background is visible.
 4] StartUpPosition – The location where
Common Properties for all
the controls
 Name  used to provide an unique
identity for the controls.
 Text  to set or get the value from the
controls.
 Anchor  used to specify the resize
property.
 Dock  used to specify the fill mode
 TextBox: t is used to accept a single line,multiline or
password character input.
 Properties for TextBox
 Charactercasing used to specify the input case.
 Maxlength  to restrict the size of the input.
 Multiline  if set to true then input can be accepted in
multiple lines.
 Password char  used to accept the input as a
password character.
 ScrollBars  used to set the scrollbars for the textbox
control.

Button : used to generate the action.


 Radio Button Control it is used to select
one item among the collection of list
items.
 Note: when ever a control is placed
within another control then they share a
relationship
Form which is called an
containment
Containment

Button

roperty : Checked  returns true if the radio button select


lse returns false.
 Group control  It is used to logically group the
controls together.
 Picture Box Control  It is used to project the images on
to the form.

 Property  Image  accepts image object which has to


be projected on the form.]
 Methods  Image.RotateFlip  it is used to rotate the
contents of the image I.e Pixel Values.
RotateFlip(RotateAngleFlipDirection)

90 X
180 Y
270 XY
none none
 Image.FromFile  It is used to define an image object
based on the fie passed by the user.
 Image.Save used to save the contents present in the
picture box control as an image.
 Refresh  it is used to refresh the picture box control
with the new pixel information
 OpenFileDialog Control  It is used to project
the Dialog box to select a file which is already
existing.
 SaveFileDialog Control  It is used to specify a
file name which is not existing in order to save
the contents with the specified file name.
 Note: if the user specifies a file name which is

existing then the system will prompt the user


to replace the existing file.
 Properties for OpenFileDialog control and
SaveFileDialog controls are same.They are as
follows 
 Filter  It is used to filter the files while

displayng the file names in the dialog box


based on the specified file extensions.
 FileName  It is used to get the name of the

file provided or selected in the dialog box


control.
 CheckBox Control used as a decision making
control or it can be used to select more then one
item from the collection
 Property Checked  returns true if the item is
selected else returns false
 Combo Box Control it is used to search an
item from a collection of list items.
 Properties
 Items  maintains the collection of list items.
 SelectedItem  returns the selected item from the
items collection.
{ note  you don’t have SelectedItem.Value /
SelectedItem.Text in C# as in asp.net}
 SelectedIndex returns the index no of the selected
item
 Combo Box is of 3 types 

 Simple combo
 Dropdown combo
 It is an editable control and the search
will take place if the combo box is
expanded.
 Dropdown list
 It is an non editable control which allows
to select an existing item from the list
control if the combo box is been
expanded.

You might also like