Вы находитесь на странице: 1из 10

COMMON PROPERTIES & Nomenclatures

Of
Some COMMON ELEMENTS of BLEND

TEXT BLOCK
txtTextBlock

.Text

: Gets or Sets the text content of this element

.ClearValue

: Clears the local value of a property

.Visibility

: Gets or Sets the UI visibility of this element

.IsEnabled

: Gets or Sets the value indicating whether this element is enabled in UI

.Focus

: Attempts to set focus to this element

.Clear

: Clears all the content of the Text Box

.ClearValue

: ------same as Text Block--------

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.Text

: ------same as Text Block--------

.Visibility

: ------same as Text Block--------

TEXT BOX
txtTextBox

PASSWORD BOX
txtPasswordBox

.Clear

: ------same as Text Box--------

.ClearValue

: ------same as Text Block--------

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.Password

: Gets or Sets the password currently held by the element

.ToString

: Returns the string representation of the elements content

.Visibility

: ------same as Text Block--------

LIST BOX
lstListBox

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.Items .Add
.Clear

: Adds an Item to the List Box collection


: Clears the collection and releases the refrences on all items
currently in the list box collection
: Gets the number of records in the list box collection
: Returns the index of this collection where the specified item is
Located
: Gets or Sets the item at the given zero-based index
: Removes the specified item reference from collection or view
: Removes the item at the specified Index from collection or view

.Count
.IndexOf
.Item
.Remove
.RemoveAt
.SelectedIndex

: Gets or Sets the Index of the first item in the current selection or
returns negative one (-1) if the selection is empty

.SelectedItem

: Gets or Sets the Index of the first item in the current selection or
returns negative one (-1) if the selection is empty

.SelectedItems

: Gets the list of selected items

.SelectedValue

: Gets or Sets the value of the selected item

.SelectionMode

: Gets or Sets the selection behaviour for the List Box Items

.Visibility

: ------same as Text Block--------

COMBO BOX
cboComboBox .Focus

: ------same as Text Block--------

.IsEditable

: Gets or Sets the editing property of the element.

.IsEnabled

: ------same as Text Block--------

.Items .Add
.Clear
.Count
.IndexOf
.Item
.Remove
.RemoveAt

: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box--------

.SelectedIndex

: ------same as List Box--------

.SelectedItem

: ------same as List Box--------

.SelectedItems

: ------same as List Box--------

.SelectedValue

: ------same as List Box--------

.SelectionMode

: ------same as List Box--------

.Text

: ------same as Text Block--------

.Visibility

: ------same as List Box--------

BUTTON
cmdButton

.Content

: Gets or Sets the content of the button

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.Visibility

: ------same as Text Block--------

.Children

.Add
.Clear
.Count
.IndexOf
.Item
.Remove
.RemoveAt

GRID
grdGrid

: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box--------

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.Visibility

: ------same as Text Block--------

CHECK BOX
chkCheckBox

.Content

: ------same as Button--------

.Focus

: ------same as Text Block--------

.IsChecked

: Gets or Sets whether the Element is checked

.IsEnabled

: ------same as Text Block--------

.Visibility

: ------same as Text Block--------

RADIO BUTTON
rdbRadioButton

.Content

: ------same as Button--------

.Focus

: ------same as Text Block--------

.IsChecked

: ------same as Check Box--------

.IsEnabled

: ------same as Text Block--------

.Visibility

: ------same as Text Block--------

DATA GRID
dgDataGrid

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.Items .Add
.Clear
.Count
.IndexOf
.Item
.Remove
.RemoveAt

: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box--------

.SelectedItem

: ------same as List Box--------

.SelectedItems

: ------same as List Box--------

.SelectedValue

: ------same as List Box--------

.SelectionMode

: ------same as List Box--------

.Visibility

: ------same as Text Block--------

.DisplayDate

: Gets or Sets the date to display

.DisplayMode

: Gets or Sets the value of the calendar which displays either


month, year or decade

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.SelectedDate

: Gets or Sets the currently selected date

.SelectedDates

: Gets a collection of selected dates

.SelectionMode

: Gets or Sets a value that indicates what kind of selection is made

.ToString

: Gives the text representation of the selected date

.Visibility

: ------same as Text Block--------

. Visibility

: ------same as Text Block--------

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

.SelectedDate

: ------same as Calendar--------

.SelectionMode

: ------same as Calendar--------

.Text

: ------same as Text Block--------

CALENDAR
calCalendar

DATE PICKER
dtDatePicker

.ToString

: ------same as Calendar--------

.Visibility

: ------same as Text Block--------

STACK PANEL
stkStackPanel .Children

.Add
.Clear
.Count
.IndexOf
.Item
.Remove
.RemoveAt

: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box-------: ------same as List Box--------

.Focus

: ------same as Text Block--------

.IsEnabled

: ------same as Text Block--------

. Visibility

: ------same as Text Block--------

WRAP PANEL
wrpWrapPanel .Children

.Add
.Clear
.Count
.IndexOf
.Item
.Remove
.RemoveAt

: ------same as Stack Panel-------: ------same as Stack Panel -------: ------same as Stack Panel -------: ------same as Stack Panel -------: ------same as Stack Panel -------: ------same as Stack Panel -------: ------same as Stack Panel --------

.Focus

: ------same as Stack Panel --------

.IsEnabled

: ------same as Stack Panel --------

. Visibility

: ------same as Stack Panel --------

USER CONTROL
ctrUserControl

COLLECTION
colCollection

.Add

: Add elements to the present value list.

.Remove

: Remove the elements from the present value list.

.Count

: Counts the total number of elements in the collection.

.Clear

: Clears the collection and removes all elements from it.

COLLECTIONS
In general terms, a collection is an object used for grouping and managing related objects. Visual Basic .Net
Collections are data structures that holds data in different ways for flexible operations and is an ordered set
of items that can be referred to as a unit. Visual Basic also provides a Collection class, with which you can
define and create your own collections. The Collection class also provides you with the built-in functionality
to loop through elements using For Each...Next and to retrieve elements by index.

A collection can be zero-based or one-based, depending on what its starting index is. The former
means that the index of the first item in the collection is 0, and the latter means that it is 1. An
example of a zero-based collection is the .NET Framework Controls collection, discussed earlier
on this page. The Visual Basic Collection object is an example of a one-based collection.
One-based collections can be more intuitive to Visual Basic users, because the index ranges from 1
through the value of the Count Property (Collection Object), which returns the number of items in a
collection.
Instances of the Visual Basic Collection class allow you to access an item using either a numeric
index or a String key. You can add items to Visual Basic Collection objects either with or without
specifying a key. If you add an item without a key, you must use its numeric index to access it.
The Visual Basic Collection object is a general-purpose programming tool; it is more flexible than
some other collections. It has an Add Method (Collection Object) for putting items into the
collection and a Remove Method (Collection Object) for taking items out.
The Visual Basic Collection object provides a convenient way to refer to a related group of items as
a single object. The items, or elements, in a collection need only be related by the fact that they exist
in the collection. Elements of a collection do not have to share the same data type.
You can create a collection the same way you create other objects, as the following example
illustrates.

Dim colCollection As New Microsoft.VisualBasic.Collection()

Or simply; Dim colCollection as New Collection


Once you have created a collection, you can do any of the following:

Add an element with the Add Method.


Remove an element with the Remove Method.
Remove all elements with the Clear Method.
Find out how many elements the collection contains with the Count Property.
Check whether a specific element is present with the Contains Method.
Return a specific element from the collection with the Item Property.
Iterate through the entire collection with the For Each...Next Statement (Visual Basic).

The properties and methods of the Collection object provide only the most basic services for
collections. For example, the Add method cannot check the type of an element being added to a
collection, which you might want to do to ensure that the collection contains only one kind of
element. If you can ensure this in the Add method, you have a strongly-typed collection, and you do
not have to convert the return from the Item property to its run-time data type. This improves your
performance.
You can provide more robust functionality and additional properties, methods, and events by
creating your own collection class.

COLLECTION VS ARRAY
Collections are very similar to arrays. They are used to store a number of values (or variables), so
that you can process them all.

There are a number of differences between arrays and collections. First difference is that the
indexing for arrays starts with zero, while for a collection it starts with 1. To understand this,
consider the image below:

Now the statement V = A(3) will place the value 55 in V because the indexing start at zero in
arrays. However the similar statement V = C(3) will place 43 instead because collection indexing is
different. The same applies for the second statement.
Another important difference is the data type. All Array elements has the same data type. So if you
have an array:
Dim A(0 To 9) As Integer
then A(0), A(1), A(2) A(9) are all Integers. Collections on the other hand do not require this. You
can store integers, reals, strings, bytes, etc. in the same collection. This can be illustrated below:

Usually you will use the same data type for all elements of the collection; however you still have
the option to use different data types whenever you need to.
Another difference between arrays and collections is that collections can add elements and remove
elements directly and change in size without any need for some kind of processing, while arrays are
fixed in size, and you cannot insert values at specific locations at random.

Finally array elements can be updated and overwritten, while collections are not. To make this clear
check out this:

In this example if you write C(3) = 55 you get an error, that is because collection does not allow
you to update or overwrite the content of an element. However there is a way to overcome this. We
will discuss this later.
Now let us see how to define a collection. There are two ways to define a collection:
Dim C As New Collection

In this example you create a collection object that is ready to be used. So you can add, remove
elements, get the number of items, or do whatever you want with the collection directly. Another
way is:
Dim C As Collection

here C is not ready yet to be used. It does not point to a collection yet. You can never use it. To be
able to use it later on in the code you should write:
C = New Collection

This will allow you to use the collection without any problem. The first method of defining a
collection is the one you will probably use the most.
Now in order to add elements to the collection you use the add method.

When you write C.Add the compiler shows you the parameters that you should provide. The ones in
the square brackets are optional. The parameters are:

Item: is the value you want to store


Key: you can provide a text value to quickly access the elements of collection instead of
providing numbers to access them. For example the code below will store the value 40 in V:

Dim C As New Collection


C.Add(33, "Smith")
C.Add(40, "Michel")
C.Add(77, "John")
Dim V As String
V = C("Michel")

Before: is the index of the item you want the new element to be inserted before.
After: is the index of the item you want the new element to be inserted after.

Next is removing elements. This simple, you just provide the index of the element you want to
remove:
C.Remove(3)

This removes the 3rd element from the collection.


Also getting the number of elements is as easy. You use the count function.
I = C.Count

Finally we describe how to simulate the functionality replacing or updating an item in the array
using collection.
If we write :
C.Add(N, , , 7)
C.Remove(7)

This will have exactly the same effect as:


A(6) = N

Вам также может понравиться