Foxtable(狐表)用户栏目专家坐堂 → [求助]自定义窗体点关闭时如何关闭程序


  共有4852人关注过本帖平板打印复制链接

主题:[求助]自定义窗体点关闭时如何关闭程序

帅哥哟,离线,有人找我吗?
jnletao
  1楼 | 信息 | 搜索 | 邮箱 | 主页 | UC


加好友 发短信
等级:四尾狐 帖子:936 积分:7719 威望:0 精华:0 注册:2013/7/7 13:37:00
[求助]自定义窗体点关闭时如何关闭程序  发帖心情 Post By:2013/12/27 15:29:00 [只看该作者]

自定义窗体点关闭时如何关闭程序
 下载信息  [文件大小:   下载次数: ]
点击浏览该文件:启动时切换数据源.foxdb

全局代码

Public DataStr As String = ""
Public ButtonYes As Boolean = False

Public Class FormData
Inherits System.Windows.Forms.Form

Private Sub ButtonOK_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ButtonOK.Click
'确定
If ComboBoxData.Text.Trim.Length < 1 Then
Messagebox.Show("请选择使用账套!","账套选择",MessageBoxButtons.OK,MessageBoxIcon.Information)
Return
End If
DataStr = ComboBoxData.Text
ButtonYes = True
Me.Close()
End Sub

Private Sub FormData_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Me.ComboBoxData = New System.Windows.Forms.ComboBox
Me.Label1 = New System.Windows.Forms.Label
Me.ButtonOK = New System.Windows.Forms.Button
Me.SuspendLayout()
'
'ComboBoxData
'
Me.ComboBoxData.FormattingEnabled = True
Me.ComboBoxData.Location = New System.Drawing.Point(85, 27)
Me.ComboBoxData.Name = "ComboBoxData"
Me.ComboBoxData.Size = New System.Drawing.Size(156, 20)
Me.ComboBoxData.TabIndex = 0
'
'Label1
'
Me.Label1.AutoSize = True
Me.Label1.Location = New System.Drawing.Point(12, 30)
Me.Label1.Name = "Label1"
Me.Label1.Size = New System.Drawing.Size(65, 12)
Me.Label1.TabIndex = 1
Me.Label1.Text = "可选账套:"
'
'ButtonOK
'
Me.ButtonOK.Font = New System.Drawing.Font("宋体", 12.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(134, Byte))
Me.ButtonOK.Location = New System.Drawing.Point(154, 80)
Me.ButtonOK.Name = "ButtonOK"
Me.ButtonOK.Size = New System.Drawing.Size(87, 29)
Me.ButtonOK.TabIndex = 2
Me.ButtonOK.Text = "确定"
Me.ButtonOK.UseVisualStyleBackColor = True
'
'FormData
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(253, 121)
Me.Controls.Add(Me.ButtonOK)
Me.Controls.Add(Me.Label1)
Me.Controls.Add(Me.ComboBoxData)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "FormData"
Me.Text = "请选择帐套"
Me.ResumeLayout(False)
Me.PerformLayout()

End Sub
Friend WithEvents ComboBoxData As System.Windows.Forms.ComboBox
Friend WithEvents Label1 As System.Windows.Forms.Label
Friend WithEvents ButtonOK As System.Windows.Forms.Button

End Class


BeforeOpenProject

Dim frm As New FormData
frm.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
frm.TopMost = True '或 e.HideSplashForm = True
frm.ShowDialog() '模式打开

If ButtonYes Then
'你的策略
msgbox(DataStr)
End If


 回到顶部