📄 publisherselect.frm
字号:
VERSION 5.00
Begin VB.Form frmSelectPublisher
BackColor = &H00C0C0C0&
BorderStyle = 3 'Fixed Dialog
Caption = "Chapter 3.13 - Publisher List"
ClientHeight = 3555
ClientLeft = 930
ClientTop = 2715
ClientWidth = 3090
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
LinkTopic = "Form2"
MaxButton = 0 'False
MinButton = 0 'False
PaletteMode = 1 'UseZOrder
ScaleHeight = 3555
ScaleWidth = 3090
Begin VB.CommandButton cmdCancel
Cancel = -1 'True
Caption = "&Cancel"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Left = 1890
TabIndex = 3
Top = 2880
Width = 1095
End
Begin VB.CommandButton cmdOK
Caption = "&OK"
Default = -1 'True
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 555
Left = 120
TabIndex = 2
Top = 2880
Width = 1095
End
Begin VB.CheckBox chkDeleteAll
BackColor = &H00C0C0C0&
Caption = "&Delete All"
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 315
Left = 120
TabIndex = 1
Top = 2460
Width = 1215
End
Begin VB.ListBox lstPublishers
BeginProperty Font
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 2205
Left = 120
Sorted = -1 'True
TabIndex = 0
Top = 150
Width = 2835
End
End
Attribute VB_Name = "frmSelectPublisher"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Private Const BIBLIO_PATH = "D:\Program Files\Microsoft Visual Studio\VB6\Biblio.MDB"
Private strPublisherToDelete As String
Public Function GetPublisher() As String
Me.Show vbModal
GetPublisher = strPublisherToDelete
Unload Me
End Function
Private Sub Form_Load()
Dim dbfBiblio As Database, recSelect As Recordset
Dim strSQL As String
On Error GoTo LoadError
Set dbfBiblio = DBEngine.Workspaces(0).OpenDatabase(BIBLIO_PATH)
strSQL = "SELECT DISTINCT [Name] FROM [Publisher Titles]"
Set recSelect = dbfBiblio.OpenRecordset(strSQL)
If recSelect.RecordCount > 0 Then
recSelect.MoveFirst
Do Until recSelect.EOF
lstPublishers.AddItem recSelect![Name]
recSelect.MoveNext
Loop
End If
On Error GoTo 0
Exit Sub
LoadError:
MsgBox Err.Description, vbExclamation
strPublisherToDelete = ""
Me.Hide
Exit Sub
End Sub
Private Sub cmdOK_Click()
If chkDeleteAll Then
strPublisherToDelete = "*"
Me.Hide
ElseIf lstPublishers.ListIndex > -1 Then
strPublisherToDelete = lstPublishers.Text
Me.Hide
End If
End Sub
Private Sub lstPublishers_DblClick()
cmdOK_Click
End Sub
Private Sub cmdCancel_Click()
strPublisherToDelete = ""
Me.Hide
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -