Basic Stuff

Preview:

DESCRIPTION

Very basic stuff on variables (primitive and non-primitive types) + TextBox.

Citation preview

Variables -

Primitive & Non-Primitive types

Primitive and Non-primitive (Object) types

Primitive types[Declaration]Dim x As Integer[Usage]x = 1

Non-Primitive types[Declaration]Dim y As TextBox[Instantiation]y = new TextBox( )[Usage]y.Text = "my

name"y.Visible = False

Primitive types

[Declaration]Dim x As Integer

Primitive types

[Usage]x = 1

Non-Primitive types

[Declaration]Dim y As TextBox

Non-Primitive types

[Instantiation]y = New TextBox( )

Non-Primitive types

[Usage]y.Text = "Name"

Primitive and Non-primitive (Object) types

Primitive types[Declaration]Dim x As Integer[Usage]x = 1

Special case:String is not

primitive but is used like one

Non-Primitive types[Declaration]Dim y As TextBox[Instantiation]y = new TextBox( )[Usage]y.Text = "my

name"y.Visible = False

What is TextBox1.Text?

What is TextBox1.Text?

TextBox is a Control provided by Microsoft. It defines a Class with behaviours,

properties and events.=> later we shall use VS 2005 to view

these behaviours, properties and events.

What is TextBox1.Text?

To use the control, we need to declare and instantiate.

In Form1.Designer.vb:

[Declaration]

Friend WithEvents TextBox1 As System.Windows.Forms.TextBox

[Instantiation]

Me.TextBox1 = New System.Windows.Forms.TextBox

What is TextBox1.Text?

1) View partial class Form1.Designer.vb2) Right click on TextBox in "New

System.Windows.Forms.TextBox"3) Select Go To Definition

What is TextBox1.Text?

behaviours / methods

properties

events

TextBox1.Text

Recommended