13
Variables - Primitive & Non- Primitive types

Basic Stuff

Embed Size (px)

DESCRIPTION

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

Citation preview

Page 1: Basic Stuff

Variables -

Primitive & Non-Primitive types

Page 2: Basic Stuff

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

Page 3: Basic Stuff

Primitive types

[Declaration]Dim x As Integer

Page 4: Basic Stuff

Primitive types

[Usage]x = 1

Page 5: Basic Stuff

Non-Primitive types

[Declaration]Dim y As TextBox

Page 6: Basic Stuff

Non-Primitive types

[Instantiation]y = New TextBox( )

Page 7: Basic Stuff

Non-Primitive types

[Usage]y.Text = "Name"

Page 8: Basic Stuff

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

Page 9: Basic Stuff

What is TextBox1.Text?

Page 10: Basic Stuff

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.

Page 11: Basic Stuff

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

Page 12: Basic Stuff

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

Page 13: Basic Stuff

What is TextBox1.Text?

behaviours / methods

properties

events

TextBox1.Text