Advertisement
imjyb1008

Untitled

Oct 31st, 2013
114
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
VB.NET 0.57 KB | None | 0 0
  1. Public Class Form1
  2.  
  3.     Dim temp As Integer = 0
  4.  
  5.     Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
  6.  
  7.         TextBox1.Text = temp
  8.  
  9.     End Sub
  10.  
  11.     Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
  12.  
  13.         temp = temp + 1
  14.         TextBox1.Text = Integer.Parse(temp)
  15.         'Integer.Parse(xxx),將變數xxx轉換成Integer
  16.     End Sub
  17.  
  18.     Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
  19.  
  20.         temp = temp - 1
  21.         TextBox1.Text = Integer.Parse(temp)
  22.  
  23.     End Sub
  24.  
  25. End Class
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement