📄 monthview.frm
字号:
VERSION 5.00
Object = "{86CF1D34-0C5F-11D2-A9FC-0000F8754DA1}#2.0#0"; "MSCOMCT2.OCX"
Object = "{67397AA1-7FB1-11D0-B148-00A0C922E820}#6.0#0"; "MSADODC.OCX"
Begin VB.Form Form1
Caption = "日历"
ClientHeight = 2715
ClientLeft = 60
ClientTop = 345
ClientWidth = 7500
LinkTopic = "Form1"
ScaleHeight = 2715
ScaleWidth = 7500
StartUpPosition = 3 '窗口缺省
Begin VB.CommandButton Command2
Caption = "更新备注"
Height = 375
Left = 5280
TabIndex = 4
Top = 2280
Width = 855
End
Begin MSAdodcLib.Adodc Adodc1
Height = 330
Left = 240
Top = 2280
Visible = 0 'False
Width = 3735
_ExtentX = 6588
_ExtentY = 582
ConnectMode = 0
CursorLocation = 3
IsolationLevel = -1
ConnectionTimeout= 15
CommandTimeout = 30
CursorType = 3
LockType = 3
CommandType = 1
CursorOptions = 0
CacheSize = 50
MaxRecords = 0
BOFAction = 0
EOFAction = 0
ConnectStringType= 1
Appearance = 1
BackColor = -2147483643
ForeColor = -2147483640
Orientation = 0
Enabled = -1
Connect = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb;Persist Security Info=False"
OLEDBString = "Provider=Microsoft.Jet.OLEDB.4.0;Data Source=data.mdb;Persist Security Info=False"
OLEDBFile = ""
DataSourceName = ""
OtherAttributes = ""
UserName = ""
Password = ""
RecordSource = "select * from 日程"
Caption = "Adodc1"
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "宋体"
Size = 9
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
_Version = 393216
End
Begin MSComCtl2.MonthView MonthView1
Height = 2220
Left = 120
TabIndex = 3
Top = 0
Width = 4065
_ExtentX = 7170
_ExtentY = 3916
_Version = 393216
ForeColor = -2147483630
BackColor = -2147483633
Appearance = 1
StartOfWeek = 23592961
CurrentDate = 37810
End
Begin VB.CommandButton Command1
Caption = "退出程序"
Height = 375
Left = 6360
TabIndex = 2
Top = 2280
Width = 975
End
Begin VB.TextBox Text1
BeginProperty Font
Name = "华文中宋"
Size = 15.75
Charset = 134
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 1575
Left = 4320
MultiLine = -1 'True
TabIndex = 0
Text = "monthview.frx":0000
Top = 600
Width = 3015
End
Begin VB.Label Label1
Alignment = 2 'Center
Caption = "备注"
BeginProperty Font
Name = "隶书"
Size = 18
Charset = 134
Weight = 700
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
Height = 375
Left = 4560
TabIndex = 1
Top = 120
Width = 2535
End
End
Attribute VB_Name = "Form1"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = False
Attribute VB_PredeclaredId = True
Attribute VB_Exposed = False
Option Explicit
Dim ExistFlag As Boolean
' 退出程序
Private Sub Command1_Click()
End
End Sub
' 更新备注信息
Private Sub Command2_Click()
If ExistFlag Then
Adodc1.Recordset.Update
Else
Adodc1.Recordset.AddNew
End If
Adodc1.Recordset!Date = MonthView1.Value
Adodc1.Recordset!Note = Text1.Text
Adodc1.Recordset.Update
End Sub
Private Sub Form_Load()
Dim findstr As String
Text1.Text = ""
Adodc1.RecordSource = "select * from 日程 where Date = DATEVALUE( '" & MonthView1.Value & " ')"
Adodc1.Refresh
Text1.Text = Adodc1.Recordset!Note
End Sub
' 选择日期时,显示相应的备注信息
Private Sub MonthView1_DateClick(ByVal DateClicked As Date)
Adodc1.RecordSource = "select * from 日程 where Date = DATEVALUE( '" & MonthView1.Value & " ')"
Adodc1.Refresh
If Adodc1.Recordset.RecordCount = 0 Then
ExistFlag = False
Text1.Text = ""
Else
ExistFlag = True
Text1.Text = Adodc1.Recordset!Note
End If
End Sub
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -