L="select*fromdataorderby学号"
Adodc1.RecordSource=SQL
Adodc1.Refresh
str="select学号,学期,科目,成绩fromchengjiwhere学号="&Val(Text1.Text)&"orderby学期"
'MsgBoxstr
Adodc2.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+App.Path+"\data.MDe;PersistSecurityInfo=False"
Adodc2.CommandType=adCmdText
SQL=str
Adodc2.RecordSource=SQL
tablename="orders"
Adodc2.Refresh
SetDataGrid1.DataSource=Adodc2
DataGrid1.Refresh
EndSub
PrivateSubText1_Change()
DimiAsInteger
DimstrAsString
str="select学号,学期,科目,成绩fromchengjiwhere学号="&Val(Text1.Text)&"orderby学期"
'MsgBoxstr
SQL=str
Adodc2.ConnectionString="Provider=Microsoft.Jet.OLEDB.4.0;DataSource="+App.Path+"\data.MDe;PersistSecurityInfo=False"
Adodc2.CommandType=adCmdText
Adodc2.RecordSource=SQL
tablename="orders"
Adodc2.Refresh
SetDataGrid1.DataSource=Adodc2
DataGrid1.Refresh
EndSub
PrivateSubxiugai_Click()
Form1.Show1
EndSub
PrivateSubxiugai1_Click()
Form6.Show1
EndSub
OptionExplicit
DimFileNameAsString'文件名,用于打开、保存文件
DimUndoStringAsString'用于Undo操作
DimUndoNewAsString'用于Undo操作
PrivateSubImgUndoDisable()
'禁用"Undo"按钮
UndoString=""
UndoNew=""
ImgUndo.Enabled=False
ImgUndo.Picture=ImageDisable.ListImages("Undo").Picture
EndSub
PrivateSubImgUndoEnable()
'有效"Undo"按钮
ImgUndo.Enabled=True
ImgUndo.Picture=ImageUp.ListImages("Undo").Picture
EndSub
PrivateSubCheck_ImgPaste()
'设置粘贴按钮
IfLen(Clipboard.GetText)>0Then
ImgPaste.Enabled=True
ImgPaste.Picture=ImageUp.ListImages("Paste").Picture
Else
ImgPaste.Enabled=False
ImgPaste.Picture=ImageDisable.ListImages("Paste").Picture
EndIf
EndSub
PrivateSubCheck_ImgCutCopy()
'设置剪切、复制按钮
IfText1.SelLength>0Then
ImgCut.Enabled=True
ImgCut.Picture=ImageUp.ListImages("Cut").Picture
ImgCopy.Enabled=True
ImgCopy.Picture=ImageUp.ListImages("Copy").Picture
Else
ImgCut.Enabled=False
ImgCut.Picture=ImageDisable.ListImages("Cut").Picture
ImgCopy.Enabled=False
ImgCopy.Picture=ImageDisable.ListImages("Copy").Picture
EndIf
EndSub
PrivateSubBackColor_Click()
CommonDialog1.ShowColor
Text1.BackColor=CommonDialog1.Color
EndSub
PrivateSubBox_Click()
'显停工具栏
IfBox.CheckedThen
'将停显工具栏
Box.Checked=False
CoolBar1.Visible=False
Else
Box.Checked=True
CoolBar1.Visible=True
EndIf
Form_Resize'重新调整控件位置
EndSub
PrivateSubClose_Click()
DimFileNumAsInteger
IfLen(FileName)>0Then
'有输入文件名
FileNum=FreeFile()'获得可用文件号
OpenFileNameForOutputAsFileNum'打开输出文件
'如果无指定文件,则创建新文件
Print#FileNum,Text1.Text'输出文本
CloseFileNum'关闭文件
EndIf
Text1.Text=""
FileName=""
EndSub
PrivateSubComboSize_Click()
Text1.FontSize=Val(ComboSize.Text)
EndSub
PrivateSubComboFont_Click()
Text1.FontName=ComboFont.Text
EndSub
PrivateSubCopy_Click()
Clipboard.SetTextText1.SelText'复制文本到剪裁板
EndSub
PrivateSubCut_Click()
Clipboard.SetTextText1.SelText'复制文本到剪裁板
Text1.SelText=""'清选择的文本
EndSub
PrivateSubDataTime_Click()
Text1.SelText=Now
EndSub
PrivateSubDelete_Click()
Text1.SelText=""'清选择的文本
EndSub
PrivateSubEdit_Click()
'当程序显示"编辑"子菜单前,触发该程序
IfText1.SelLength>0Then
'文本框中有选中的文本
Cut.Enabled=True
Copy.Enabled=True
Delete.Enabled=True
Else
Cut.Enabled=False
Copy.Enabled=False
Delete.Enabled=False
EndIf
IfLen(Clipboard.GetText())>0Then
'剪裁板中有文本数据
Paste.Enabled=True
Else
'没有可粘贴的文本
Paste.Enabled=False
EndIf
EndSub
PrivateSubExit_Click()
UnloadMe
EndSub
PrivateSubFindText_KeyPress(KeyAsciiAsInteger)
DimBeginPosAsLong
IfKeyAscii=13Then
BeginPos=InStr(1,Text1.Text,FindText.Text,vbTextCompare)
IfBeginPos>0Then
Text1.SelStart=BeginPos-1
Text1.SelLength=Len(FindText.Text)
EndIf
EndIf
EndSub
PrivateSubFontcolor_Click()
CommonDialog1.ShowColor
Text1.ForeColor=CommonDialog1.Color
EndSub
PrivateSubForm_Load()
DimiAsInteger
'加载图像
ImgNew.Picture=ImageUp.ListImages("New").Picture
ImgOpen.Picture=ImageUp.ListImages("Open").Picture
ImgSave.Picture=ImageUp.ListImages("Save").Picture
ImgUndo.Picture=ImageDisable.ListImages("Undo").Picture
Check_ImgPaste
Check_ImgCutCopy
'加载系统字体
Fori=0ToScreen.FontCount-1
ComboFont.AddItemScreen.Fonts(i)
Nexti
EndSub
PrivateSubForm_Resize()
DimTextTopAsLong
'修改工具条大小
CoolBar1.Top=Me.ScaleTop
Me.ScaleLeft
Text1.Width=Me.ScaleWidth
IfMe.ScaleHeight>CoolBar1.HeightThen
Text1.Height=Me.ScaleHeight-TextTop
Else
Text1.Height=0
EndIf
EndSub
PrivateSubImgCopy_Click()
Copy_Click'复制
Check_ImgPaste
Check_ImgCutCopy
EndSub
PrivateSubImgCopy_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
'"按下"按钮
IfButton=1Then
ImgCopy.Picture=ImageDown.ListImages("Copy").Picture
EndIf
EndSub
PrivateSubImgCopy_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
Label1="将选择的文本复制到剪裁板"
'判断鼠标位置,显示不同图像
IfButton=1And(X>0AndX0AndY
ImgCopy.Picture=ImageDown.ListImages("Copy").Picture
ElseIfButton=1Then
ImgCopy.Picture=ImageUp.ListImages("Copy").Picture
EndIf
EndSub
PrivateSubImgCopy_MouseUp(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
IfButton=1Then
'"抬起"按钮
ImgCopy.Picture=ImageUp.ListImages("Copy").Picture
EndIf
EndSub
PrivateSubImgCut_Click()
'IfText1.SelLength>0Then
Cut_Click'剪切
Check_ImgPaste
Check_ImgCutCopy
'EndIf
EndSub
PrivateSubImgCut_MouseDown(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
IfButton=1Then
'"按下"按钮
ImgCut.Picture=ImageDown.ListImages("Cut").Picture
EndIf
EndSub
PrivateSubImgCut_MouseMove(ButtonAsInteger,ShiftAsInteger,XAsSingle,YAsSingle)
Label1="剪切选择的文字到剪裁板"
'判断鼠标位置,显示不同图像
IfButton=1And(X>0AndX0AndY
ImgCut.Picture=ImageDown.ListImages("Cut").Picture
ElseIfButton=1Then
ImgCut.Picture=ImageUp.ListImages("Cut").Picture
EndIf
EndSub
PrivateSubI
上一篇:
VB学生成绩管理系统VC(论文含功能结构图、业务流程图、数据流图、数据字典、E-R图)(论文和程序)
下一篇:
还记得,那年的风车吗?