- 分享
- 0
- 人气
- 0
- 主题
- 8
- 帖子
- 3950
- UID
- 95252
- 积分
- 4741
- 阅读权限
- 22
- 注册时间
- 2007-8-24
- 最后登录
- 2013-6-29
- 在线时间
- 937 小时
  
|
不知道为什么,Form_Load的指令不会跑,请求各位帮忙找出问题
Option Explicit On
Public Class Form1
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
NameBox.Focus()
End Sub
Public frm2 As New Form2
Private Sub ExitButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ExitButton.Click
Me.Close()
End Sub
Private Sub NameBox_KeyPress1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles NameBox.KeyPress
If Asc(e.KeyChar) >= 47 And Asc(e.KeyChar) <= 57 Then
e.Handled = True
End If
End Sub
Private Sub PassBox_KeyPress1(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles PassBox.KeyPress
If Asc(e.KeyChar) < 48 Or Asc(e.KeyChar) > 57 Then
e.Handled = True
End If
End Sub
Private Sub LoginButton_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles LoginButton.Click
frm2.NameLabel.Text = NameBox.Text
Me.Hide()
Form2.Show()
End Sub
End Class |
|