Basic Stuff

432 views
392 views

Published on

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

Published in: Education, Spiritual, Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
432
On SlideShare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
7
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Basic Stuff

  1. 1. Variables - Primitive & Non-Primitive types
  2. 2. Primitive and Non-primitive (Object) types <ul><li>Primitive types </li></ul><ul><li>[Declaration] </li></ul><ul><li>Dim x As Integer </li></ul><ul><li>[Usage] </li></ul><ul><li>x = 1 </li></ul>Non-Primitive types [Declaration] Dim y As TextBox [Instantiation] y = new TextBox( ) [Usage] y.Text = &quot;my name&quot; y.Visible = False
  3. 3. Primitive types <ul><li>[Declaration] </li></ul><ul><li>Dim x As Integer </li></ul>
  4. 4. Primitive types <ul><li>[Usage] </li></ul><ul><li>x = 1 </li></ul>
  5. 5. Non-Primitive types <ul><li>[Declaration] </li></ul><ul><li>Dim y As TextBox </li></ul>
  6. 6. Non-Primitive types <ul><li>[Instantiation] </li></ul><ul><li>y = New TextBox( ) </li></ul>
  7. 7. Non-Primitive types <ul><li>[Usage] </li></ul><ul><li>y.Text = &quot;Name&quot; </li></ul>
  8. 8. Primitive and Non-primitive (Object) types <ul><li>Primitive types </li></ul><ul><li>[Declaration] </li></ul><ul><li>Dim x As Integer </li></ul><ul><li>[Usage] </li></ul><ul><li>x = 1 </li></ul><ul><li>Special case: </li></ul><ul><li>String is not primitive but is used like one </li></ul>Non-Primitive types [Declaration] Dim y As TextBox [Instantiation] y = new TextBox( ) [Usage] y.Text = &quot;my name&quot; y.Visible = False
  9. 9. What is TextBox1.Text?
  10. 10. What is TextBox1.Text? <ul><li>TextBox is a Control provided by Microsoft. </li></ul><ul><li>It defines a Class with behaviours, properties and events. </li></ul><ul><li>=> later we shall use VS 2005 to view these behaviours, properties and events. </li></ul>
  11. 11. What is TextBox1.Text? <ul><li>To use the control, we need to declare and instantiate . </li></ul><ul><li>In Form1.Designer.vb: </li></ul>[Declaration] Friend WithEvents TextBox1 As System.Windows.Forms.TextBox [Instantiation] Me.TextBox1 = New System.Windows.Forms.TextBox
  12. 12. What is TextBox1.Text? <ul><li>1) View partial class Form1.Designer.vb </li></ul><ul><li>2) Right click on TextBox in &quot; New System.Windows.Forms. TextBox &quot; </li></ul><ul><li>3) Select Go To Definition </li></ul>
  13. 13. What is TextBox1.Text? behaviours / methods properties events TextBox1.Text

×