第二章 系统设计 paper51.com
2.1系统分析 http://www.paper51.com 本vb数控加工技术教学素材资源库采用计算机专业的VB课程为内容主要由以下几大模块构成. 内容来自论文无忧网 www.paper51.com 一.概念和基本原理(vb概述,窗口控件和菜单,工程的管理,开发应用程序) 内容来自论文无忧网 www.paper51.com 二. 语言参考(关键字,函数,数据类型,伪指令,运算符) 内容来自www.paper51.com
三. API函数 内容来自www.paper51.com 四. 经典事例 copyright paper51.com 2.2系统流程和操作方式设计 内容来自论文无忧网 www.paper51.com
http://www.paper51.com 第三章 系统界面设计 copyright paper51.com 3.1系统界面设计 copyright paper51.com 主界面设计 copyright paper51.com
内容来自www.paper51.com
代码设计: copyright paper51.com
Private Declare Function ShellExecute Lib"shell32.dll" Alias "ShellExecuteA"(ByVal hwnd As Long, ByVal lpOperation As String, ByVal lpFile As String, ByVal lpParameters As String, ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long paper51.com
Private BigStyle AsString 内容来自论文无忧网 www.paper51.com Private SmallStyle AsString 内容来自www.paper51.com Private RTB1_BackCorlor As Integer paper51.com Private AddCode AsBoolean copyright paper51.com Private EditCode AsBoolean 内容来自www.paper51.com Dim Temptitle AsString 内容来自www.paper51.com Private Sub Cmdcancel_Click() paper51.com RTB1.BackColor =GetSetting(App.EXEName, "Corlor","BackCorlor", RTB1.BackColor) copyright paper51.com
Frame5.Visible =False: Frame6.Visible = False: TreeView1.Visible = True http://www.paper51.com RTB1.Locked =True 内容来自论文无忧网 www.paper51.com EditCode = False 内容来自www.paper51.com
AddCode = False http://www.paper51.com
Toolbar1.Buttons(7).Image = 5: Toolbar1.Buttons(8).Image = 6 内容来自www.paper51.com Toolbar1.Buttons(7).Caption = "全选":Toolbar1.Buttons(8).Caption = "复制" 内容来自www.paper51.com Toolbar1.Buttons(7).Tag = "Tool_SelAll":Toolbar1.Buttons(8).Tag = "Tool_Copy" 内容来自论文无忧网 www.paper51.com Menu_Plaste.Enabled = False: Menu_Clear.Enabled= False 内容来自论文无忧网 www.paper51.com End Sub paper51.com Private Sub Cmdfix_Click() 内容来自论文无忧网 www.paper51.com Frame5.Visible =False: Frame6.Visible = False: TreeView1.Visible = True copyright paper51.com Dim adoprimaryrs As New ADODB.Recordset 内容来自www.paper51.com If Cbostyle.Text = "" Then copyright paper51.com MsgBox "类别不能为空", vbCritical + vbApplicationModal,"错误" 内容来自www.paper51.com Exit Sub paper51.com End If 内容来自论文无忧网 www.paper51.com
If TxTTitle.Text = "" Then paper51.com MsgBox "标题不能为空", vbCritical + vbApplicationModal,"错误" 内容来自论文无忧网 www.paper51.com Exit Sub copyright paper51.com End If http://www.paper51.com If RTB1.Text ="" Then http://www.paper51.com MsgBox "内容不能为空", vbCritical + vbApplicationModal,"错误" paper51.com
Exit Sub copyright paper51.com End If http://www.paper51.com
内容来自www.paper51.com Select Case True 内容来自www.paper51.com Case AddCode 内容来自论文无忧网 www.paper51.com i = ExistRecord("code","标题", Trim(TxTTitle.Text)) copyright paper51.com If i Then 内容来自www.paper51.com MsgBox "该代码标题已存在,请重新修改代码标题", vbCritical + vbApplicationModal,"错误" 内容来自论文无忧网 www.paper51.com TxTTitle.SelStart= 0 copyright paper51.com
TxTTitle.SelLength = Len(Trim(TxTTitle.Text)) 内容来自论文无忧网 www.paper51.com Exit Sub http://www.paper51.com End If copyright paper51.com
Case EditCode 内容来自论文无忧网 www.paper51.com Dim adoprimarycmd As New ADODB.Command http://www.paper51.com adoprimarycmd.ActiveConnection = StrConnect copyright paper51.com
adoprimarycmd.CommandText = "delete *from code where 标题='" &Trim(Temptitle) & "'" 内容来自www.paper51.com adoprimarycmd.Execute copyright paper51.com Set adoprimarycmd = Nothing 内容来自论文无忧网 www.paper51.com End Select copyright paper51.com
adoprimaryrs.CursorLocation = adUseClient 内容来自www.paper51.com adoprimaryrs.Open "select * from code", StrConnect, adOpenKeyset, adLockOptimistic, adCmdText http://www.paper51.com adoprimaryrs.MoveLast 内容来自www.paper51.com
adoprimaryrs.AddNew paper51.com adoprimaryrs.Fields("大类别") = Trim(BigStyle) 内容来自论文无忧网 www.paper51.com adoprimaryrs.Fields("小类别") = Trim(Cbostyle) paper51.com adoprimaryrs.Fields("标题") = Trim(TxTTitle) copyright paper51.com adoprimaryrs.Fields("内容") = RTB1.Text http://www.paper51.com adoprimaryrs.Update 内容来自论文无忧网 www.paper51.com
Set adoprimaryrs = Nothing 内容来自www.paper51.com
RTB1.BackColor =GetSetting(App.EXEName, "Corlor","BackCorlor", RTB1.BackColor) 内容来自论文无忧网 www.paper51.com Call ShowTree(BigStyle) 内容来自www.paper51.com RTB1.Locked =True paper51.com EditCode = False copyright paper51.com AddCode = False 内容来自论文无忧网 www.paper51.com Toolbar1.Buttons(7).Image = 5: Toolbar1.Buttons(8).Image = 6 内容来自论文无忧网 www.paper51.com Toolbar1.Buttons(7).Caption = "全选":Toolbar1.Buttons(8).Caption = "复制" copyright paper51.com Toolbar1.Buttons(7).Tag = "Tool_SelAll":Toolbar1.Buttons(8).Tag = "Tool_Copy" 内容来自论文无忧网 www.paper51.com Menu_Plaste.Enabled = False: Menu_Clear.Enabled= False 内容来自论文无忧网 www.paper51.com RTB1.Font.Size =GetSetting(App.EXEName, "Font", "FontSize",RTB1.Font.Size) copyright paper51.com
RTB1.BackColor =GetSetting(App.EXEName, "Corlor","BackCorlor", RTB1.BackColor) 内容来自www.paper51.com End Sub 内容来自www.paper51.com |