vb.net创建一个窗口 vb如何创建窗体

如何用VB.net连接数据库做一个简单的登陆窗口?Label1.Caption = "融通系统外挂程序"
If Dir(App.Path"/hjw.mdb")"" Then
Set mydata = https://www.04ip.com/post/OpenDatabase(App.Path"\hjw")
Set myrs1 = mydata.OpenRecordset("user", dbOpenTable)
Else
Set mydata = https://www.04ip.com/post/CreateDatabase(App.Path"\hjw", dbLangGeneral, dbVersion40)
mydata.Execute "create table ku (建立日期 text(100),库名 text(100),功能 text(100))"
mydata.Execute "create table system (店号 integer,建立日期 text(100),文件路径 text(100),软件版本 text(100),路径1 text(50),路径2 text(50),路径3 text(50),路径4 text(50))"
kuname = "system"
kugn = "文件信息"
Me.showlist1
mydata.Execute "create table user (user text(50),passwd text(50),name text(50),quanx integer)"
kuname = "user"
kugn = "用户信息"
Me.showlist1
Private Sub cmdOK_Click()
txtUserName.SetFocus
If Trim(txtUserName.Text = "") Then
MsgBox "没有这个用户vb.net创建一个窗口,请重新输入用户名vb.net创建一个窗口!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
sql = "select * from user where user = '"txtUserName.Text"'"
'Debug.Print sql
'Set mrc = ExecuteSQL(sql, MsgText)
Set myrs2 = mydata.OpenRecordset(sql)
If myrs2.EOF = True Then
MsgBox "没有这个用户vb.net创建一个窗口,请重新输入用户名!", vbOKOnly + vbExclamation, "警告"
txtUserName.SetFocus
Else
If Trim(myrs2.Fields(1)) = Trim(txtPassword.Text) Then
UserName = myrs2.Fields(2)
myrs2.Close
Me.Hide
'UserName = Trim(txtUserName.Text)
'Debug.Print UserName
MDIform1.Show
Else
MsgBox "输入密码不正确vb.net创建一个窗口,请重新输入!", vbOKOnly + vbExclamation, "警告"
txtPassword.SetFocus
txtPassword.Text = ""
End If
End If
End If
End Sub
如何给VB.NET窗体添加子窗体?直接添加一个MID父窗体或在已有窗体vb.net创建一个窗口的属性中找到IsMDIContainer属性vb.net创建一个窗口,然后设置为Truevb.net创建一个窗口,然后创建第二个窗体,需要加载子窗体的时候vb.net创建一个窗口:
Dim NewMDIChild As New Form2
NewMDIChild.MdiParent = Me
NewMDIChild.Show()
Public Shared Sub CheckMDIChildForm(ByVal MDIForm As Windows.Forms.Form, ByVal MDIChildForm As Windows.Forms.Form, ByVal MDIChildFormName As String)
If MDIForm.MdiChildren.Length1 Then
'如果没有任何一个MDI子窗体,则创该MDI子窗体的窗体实例
Dim MDIChildFrm As Windows.Forms.Form = MDIChildForm ' 定义MDI子窗体
MDIChildFrm.MdiParent = MDIForm '指定父窗体
MDIChildFrm.Show() '打开窗体
Exit Sub
Else
Dim x As Integer
Dim frmyn As Boolean
For x = 0 To (MDIForm.MdiChildren.Length) - 1
Dim tempChild As Windows.Forms.Form = CType(MDIForm.MdiChildren(x), Windows.Forms.Form)
If tempChild.Name = MDIChildFormName Then
'检测到有该MDI子窗体,设为激活 并退出循环
frmyn = True
tempChild.BringToFront()
Exit For
Else
frmyn = False
End If
Next
If Not frmyn Then
'在打开的窗体中没检测到则新建
Dim MDIChildFrm As Windows.Forms.Form = MDIChildForm ' 定义MDI子窗体
MDIChildFrm.MdiParent = MDIForm '指定父窗体
MDIChildFrm.Show() '打开窗体
End If
End If
End Sub
如何创建vb.net窗体dim 一个窗体 as new form
with 一个窗体
.location=...
.size=...'这里是设置窗体的位置等属性
end with
一个窗体.show
我想用vb.net做一个Windows窗口应用程序;可以实现
搞个buttonvb.net创建一个窗口,点击的时候连接数据库vb.net创建一个窗口,写入数据

推荐阅读