项目事件
BeforeOpenProject
Dim frm As New Form1
frm.ShowDialog() '模式打开
If bl_取消 Then
e.Cancel = True
End If
If bl_确定 Then
'你的策略
msgbox(str_机器码)
msgbox(str_注册码)
End If
全局代码
Public Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
MsgBox("数量不能小于1!",64,"提示")
End Sub
Public str_机器码 As String = ""
Public str_注册码 As String = ""
Public bl_取消 As Boolean = False
Public bl_确定 As Boolean = False
Public Class Form1
Inherits System.Windows.Forms.Form
Public Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
'取消
bl_取消 = True
Me.Close()
End Sub
中间内容省略
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(390, 139)
Me.Controls.Add(Me.Label2)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.Button3)
Me.Controls.Add(Me.机器码)
Me.Controls.Add(Me.注册码)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Form1"
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents 注册码 As System.Windows.Forms.TextBox
Friend WithEvents 机器码 As System.Windows.Forms.TextBox
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents Label2 As System.Windows.Forms.Label
End Class
没有居中,Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent 也不行
大家有方法没