📄 frm_addnewbook.vb
字号:
'
Me.TxtEdition.Location = New System.Drawing.Point(352, 198)
Me.TxtEdition.Name = "TxtEdition"
Me.TxtEdition.Size = New System.Drawing.Size(140, 21)
Me.TxtEdition.TabIndex = 21
'
'TxtPublishdate
'
Me.TxtPublishdate.Location = New System.Drawing.Point(109, 233)
Me.TxtPublishdate.Name = "TxtPublishdate"
Me.TxtPublishdate.Size = New System.Drawing.Size(153, 21)
Me.TxtPublishdate.TabIndex = 22
'
'ComboStatus
'
Me.ComboStatus.Items.AddRange(New Object() {"正常", "被借"})
Me.ComboStatus.Location = New System.Drawing.Point(352, 233)
Me.ComboStatus.Name = "ComboStatus"
Me.ComboStatus.Size = New System.Drawing.Size(140, 20)
Me.ComboStatus.TabIndex = 23
'
'TxtAdditionDate
'
Me.TxtAdditionDate.Location = New System.Drawing.Point(109, 267)
Me.TxtAdditionDate.Name = "TxtAdditionDate"
Me.TxtAdditionDate.Size = New System.Drawing.Size(153, 21)
Me.TxtAdditionDate.TabIndex = 24
'
'GroupBox1
'
Me.GroupBox1.Controls.Add(Me.Label8)
Me.GroupBox1.Controls.Add(Me.TxtISBN)
Me.GroupBox1.Controls.Add(Me.TxtBookAuthor)
Me.GroupBox1.Controls.Add(Me.Label4)
Me.GroupBox1.Controls.Add(Me.Label5)
Me.GroupBox1.Controls.Add(Me.Label7)
Me.GroupBox1.Controls.Add(Me.Label2)
Me.GroupBox1.Controls.Add(Me.Label10)
Me.GroupBox1.Controls.Add(Me.ComboBookCode)
Me.GroupBox1.Controls.Add(Me.Label1)
Me.GroupBox1.Controls.Add(Me.Label3)
Me.GroupBox1.Controls.Add(Me.ComboStatus)
Me.GroupBox1.Controls.Add(Me.TxtBookCode)
Me.GroupBox1.Controls.Add(Me.Label6)
Me.GroupBox1.Controls.Add(Me.ComboBookType)
Me.GroupBox1.Controls.Add(Me.TxtPublishdate)
Me.GroupBox1.Controls.Add(Me.TxtBookName)
Me.GroupBox1.Controls.Add(Me.Label11)
Me.GroupBox1.Controls.Add(Me.TxtSN)
Me.GroupBox1.Controls.Add(Me.TxtEdition)
Me.GroupBox1.Controls.Add(Me.TxtBookDes)
Me.GroupBox1.Controls.Add(Me.TxtAdditionDate)
Me.GroupBox1.Controls.Add(Me.TxtBookType)
Me.GroupBox1.Controls.Add(Me.Label9)
Me.GroupBox1.Location = New System.Drawing.Point(10, 9)
Me.GroupBox1.Name = "GroupBox1"
Me.GroupBox1.Size = New System.Drawing.Size(508, 301)
Me.GroupBox1.TabIndex = 25
Me.GroupBox1.TabStop = False
Me.GroupBox1.Text = "书籍信息"
'
'GroupBox2
'
Me.GroupBox2.Controls.Add(Me.BtnLoad)
Me.GroupBox2.Controls.Add(Me.PictureBox1)
Me.GroupBox2.Location = New System.Drawing.Point(528, 9)
Me.GroupBox2.Name = "GroupBox2"
Me.GroupBox2.Size = New System.Drawing.Size(192, 198)
Me.GroupBox2.TabIndex = 26
Me.GroupBox2.TabStop = False
Me.GroupBox2.Text = "图片"
'
'BtnLoad
'
Me.BtnLoad.Location = New System.Drawing.Point(29, 164)
Me.BtnLoad.Name = "BtnLoad"
Me.BtnLoad.Size = New System.Drawing.Size(125, 24)
Me.BtnLoad.TabIndex = 1
Me.BtnLoad.Text = "加载图片"
'
'PictureBox1
'
Me.PictureBox1.Image = CType(resources.GetObject("PictureBox1.Image"), System.Drawing.Image)
Me.PictureBox1.Location = New System.Drawing.Point(10, 26)
Me.PictureBox1.Name = "PictureBox1"
Me.PictureBox1.Size = New System.Drawing.Size(169, 117)
Me.PictureBox1.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
Me.PictureBox1.TabIndex = 0
Me.PictureBox1.TabStop = False
'
'BtnAdd
'
Me.BtnAdd.Location = New System.Drawing.Point(557, 215)
Me.BtnAdd.Name = "BtnAdd"
Me.BtnAdd.Size = New System.Drawing.Size(125, 25)
Me.BtnAdd.TabIndex = 27
Me.BtnAdd.Text = "添加"
'
'BtnClear
'
Me.BtnClear.Location = New System.Drawing.Point(557, 250)
Me.BtnClear.Name = "BtnClear"
Me.BtnClear.Size = New System.Drawing.Size(125, 25)
Me.BtnClear.TabIndex = 28
Me.BtnClear.Text = "重置"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(557, 284)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(125, 25)
Me.Button4.TabIndex = 29
Me.Button4.Text = "退出"
'
'OpenFileDialog1
'
Me.OpenFileDialog1.FileName = "OpenFileDialog1"
'
'frm_AddNewBook
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.BackColor = System.Drawing.SystemColors.Control
Me.ClientSize = New System.Drawing.Size(734, 321)
Me.Controls.Add(Me.Button4)
Me.Controls.Add(Me.BtnClear)
Me.Controls.Add(Me.BtnAdd)
Me.Controls.Add(Me.GroupBox2)
Me.Controls.Add(Me.GroupBox1)
Me.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle
Me.Icon = CType(resources.GetObject("$this.Icon"), System.Drawing.Icon)
Me.MaximizeBox = False
Me.MinimizeBox = False
Me.Name = "frm_AddNewBook"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "添加书籍信息"
Me.GroupBox1.ResumeLayout(False)
Me.GroupBox1.PerformLayout()
Me.GroupBox2.ResumeLayout(False)
CType(Me.PictureBox1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
Private Sub frm_AddNewBook_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
add_IntoComboBookCode()
add_IntoComboBookType()
Me.ComboBookCode.SelectedIndex = 0
Me.ComboBookType.SelectedIndex = 0
Me.ComboStatus.SelectedIndex = 0
End Sub
Private Sub BtnLoad_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnLoad.Click
MsgBox("The Image should not be greater than " + PictureBox1.Width.ToString + " X" + PictureBox1.Height.ToString, MsgBoxStyle.Information, "图书馆管理系统")
OpenFileDialog1.Filter = "Picture Files|*.jpg|*.bmp|*.gif"
OpenFileDialog1.ShowDialog()
End Sub
Private Sub Button4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button4.Click
Me.Close()
End Sub
Private Sub TxtSN_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtSN.KeyPress
Dim strChar As String
strChar = e.KeyChar
Select Case strChar
Case ChrW(System.Windows.Forms.Keys.Enter)
If checkTextbox(TxtSN) = False Then
display_MsgBox("请在文本框中输入信息")
Else
If checkIfAlreadyExists() = True Then
display_MsgBox("书籍的编号已经存在!")
Else
If checkTextbox(TxtSN) = True And checkIfAlreadyExists() = False Then
TxtISBN.Focus()
End If
End If
End If
Case Else
'什么也不做
End Select
End Sub
Private Sub TxtISBN_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtISBN.KeyPress
Dim strChar As String
strChar = e.KeyChar
Select Case strChar
Case ChrW(System.Windows.Forms.Keys.Enter)
If checkTextbox(TxtISBN) = False Then
display_MsgBox("请在文本框中输入信息")
Else
If checkTextbox(TxtISBN) = True Then
TxtBookName.Focus()
End If
End If
Case Else
'什么也不做
End Select
End Sub
Private Sub TextBox3_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtBookName.KeyPress
Dim strChar As String
strChar = e.KeyChar
Select Case strChar
Case ChrW(System.Windows.Forms.Keys.Enter)
If checkTextbox(TxtBookName) = False Then
display_MsgBox("Please Fill in the field")
Else
If checkTextbox(TxtBookName) = True Then
ComboBookCode.Focus()
End If
End If
Case Else
'dotnothing
End Select
End Sub
'Private Sub ComboBookCode_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBookCode.KeyPress
' Dim strChar As String
' strChar = e.KeyChar
' Select Case strChar
' Case ChrW(System.Windows.Forms.Keys.Enter)
' If checkCombobox(ComboBookCode) = False Then
' ' display_MsgBox("请在文本框中输入信息")
' Else
' If checkCombobox(ComboBookCode) = True Then
' ' MyConnection.Open()
' MyCommand = New OleDbCommand("SELECT * FROM BookCode WHERE Code ='" & ComboBookCode.Text & "'", MyConnection)
' MyReader = MyCommand.ExecuteReader()
' While MyReader.Read
' TxtBookCode.Text = MyReader("Desc1")
' End While
' MyConnection.Close()
' MyReader.Close()
' MyCommand.Dispose()
' ComboBookType.Focus()
' End If
' End If
' Case Else
'什么也不做
' End Select
' End Sub
'' Private Sub ComboBookType_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles ComboBookType.KeyPress
''''''''''''' Dim strChar As String
''''''strChar = e.KeyChar
'''''''''Select Case strChar
''''''''' Case ChrW(System.Windows.Forms.Keys.Enter)
''''''' If checkCombobox(ComboBookType) = False Then
'''''' display_MsgBox("Please Fill in the field")
''''''''Else
''''''' If checkCombobox(ComboBookType) = True Then
'' MyConnection.Open()
' MyCommand = New OleDbCommand("SELECT * FROM BookType WHERE Type ='" & ComboBookType.Text & "'", MyConnection)
' MyReader = MyCommand.ExecuteReader()
'' While MyReader.Read
' TxtBookType.Text = MyReader("Desc")
' End While
' MyConnection.Close()
' MyReader.Close()
' MyCommand.Dispose()
' TxtBookDes.Focus()
'' End If
' End If
' Case Else
' 'dotnothing
' End Select
' End Sub
Private Sub TextBox6_KeyPress(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyPressEventArgs) Handles TxtBookDes.KeyPress
Dim strChar As String
strChar = e.KeyChar
Select Case strChar
Case ChrW(System.Windows.Forms.Keys.Enter)
If checkTextbox(TxtBookDes) = False Then
display_MsgBox("Please Fill in the field")
Else
If checkTextbox(TxtBookDes) = True Then
TxtBookAuthor.Focus()
End If
End If
Case Else
'dotnothing
End Select
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -