【正文】
。窗體截圖:下圖窗體截圖部分源碼如下:Option ExplicitDim Port_SeC As Integer39。定義串口接收的參數(shù) Dim TmpA(5)As String39。分別存儲 Dim TmpB(5)As String39。分別存儲 Dim str As String39。定義全局變量 Dim KZsj_inter As Long39??刂茣r間 Dim Rev_sendCSJL As Long39。接收到的數(shù)據(jù)容量 39。Dim MDIxzstring(1000)As String39。接收到的數(shù)據(jù)緩沖區(qū)域 Dim MDIxzLaststring As String39。接收到的數(shù)據(jù)緩沖區(qū)域 Dim CurxzPort As Integer Dim MDIxzLong As Long39。緩沖數(shù)據(jù)空間 Dim MDIformZhCur As Integer39。當(dāng)前下載的組號 Dim MDIformAdressCur As Long39。當(dāng)前下載的地址 39。Dim Date_J As Long Dim Time_J As Long 39。Private Declare Function HtmlHelpA Lib “”(ByVal hwndCaller As Long, ByVal pszFile As String, ByVal uCommand As Long, ByVal dwData As Long)As LongPrivate Sub Com_DTadress_Click()If Serial_ZWfS ThenDT_ZWadress = “ElseDT_ZWadress = amp。 ” “End IfEnd SubPrivate Sub IDM_CloseProgect_Click()Dim retIf CurProjectpath = ”“ And Projectname = ”“ ThenMsgBox ”當(dāng)前沒有激活的工程“, vbYesElseret = MsgBox(”將要關(guān)閉當(dāng)前工程,確定點擊是,取消否“, vbYesNo)If vbYes = ret ThenMDIunloadallwindowFormunloadEnd IfEnd IfEnd Sub 2)ModunloadActiveForm工程源碼分析詳解如下:工程名稱: 窗體源碼名稱:ModunloadActiveForm 功能分類: 軟件模塊 功能簡介:工程設(shè)置 部分源碼如下:Dim TotalW As Integer Public Move_H As Integer39。動態(tài)加載菜單A Public Move_Hxj As Integer39。巡檢儀器加載39。工程管理Public Projectname As String Public PrjsaveasPath As String Public CurProjectpath As String39。定義當(dāng)前工程的路徑 39。39。新建窗體start39。Public Xjbc(3)As New frmxjybc Public Qx(5)As New frmLine Public Bc(10)As New frmPro_Edit Public Yx(5)As New frmLinexy Public Tx(5)As New frmPattern Public Dw(5)As New frmPattern_Draw Public DaSet(10)As New Dialog_Setshow Public Winshowbc(10)As Boolean Public Winshowxjbc(3)As BooleanPublic Xjbc_Index As Integer Public Xj_Index As Integer Public Bc_Index As Integer Public Qx_Index As Integer Public Yx_Index As Integer Public Dw_Index As Integer Public ZjBc_Index As Integer Public ZbBc_Index As Boolean39。Public Function Formunload()As Boolean Dim i As Integer39。Projectname = ”“39。工程名為空那么刪除當(dāng)前所有的文檔CurProjectpath = ”Mainmenucongfig(Projectname)39。On Error Resume Next39。39。///////////////////////////////////////////Unload MDIForm_TimesetUnload Dialog_FindUnload Dialog_LunXunUnload FRM80Unload FRM81Unload FRM8239。//Unload frmxjybcUnload frmPatternUnload frmPattern_DrawUnload frmdataJHUnload frmGPRSUnload Dialog_DSelectUnload frmReV_SendUnload frmnewProjectUnload DaSet(SStab_Index)Unload frmalarmUnload frmPro_ProgUnload frmresetQuery_ImportUnload frmresetTimeQueryUnload Dialog_ManageDoc39。///////////////////////////////////////////////39。///////////////////////////////////////////39。For i = 1 To Move_H Step 1On Error Resume NextUnload (i)Next iFor i = 1 To Move_Hxj Step 1On Error Resume NextUnload (i)Next iFor i = 0 To Qx_Index Step 1On Error Resume NextUnload Qx(i)Next iFor i = 0 To Yx_Index Step 1On Error Resume NextUnload Yx(i)Next iFor i = 0 To Bc_Index Step 1On Error Resume NextUnload Bc(i)Next iFor i = 0 To Dw_Index Step 1On Error Resume NextUnload Dw(i)Next iFor i = 0 To Xjbc_Index Step 1On Error Resume NextUnload Xjbc(i)Next iFormunload = True End Function