【正文】
39。 All Done 39。 Unload Me End Sub Private Sub cmdFile_Click() With CommonDialog1 39。 39。 Set dialog properties 39。 .Flags = cdlOFNFileMustExist Or cdlOFNHideReadOnly .Filter = Print Files (*.prn)|*.PRN|AllFiles (*.*)|*.* 39。 39。 Get filename. Allow user to cancel. 39。 On Error Resume Next .ShowOpen 39。 39。 Place selected filename into textbox. 39。 If err = 0 Then txtFile = .Filename End If End With End Sub Private Sub cmdPrint_Click() Dim Submit As String Dim prn As Printer 39。 39。 Warn user if file doesn39。t exist. 39。 Submit = UCase(Trim(txtFile)) 電子科技大學畢業(yè)論文 家庭式 ERP系統(tǒng)分析與設計 33 If Not IsFile(Submit) Then MsgBox Can39。t find file: amp。 Submit, vbExclamation, Error Exit Sub End If 39。 39。 Submit file to spooler after extracting name. 39。 For Each prn In Printers If InStr(Combo1, ) = 1 _ And Right(Combo1, Len()) = Then Call SpoolFile(Submit, ) Exit For End If Next prn End Sub Private Sub Form_Initialize() 39。 39。 Make sure there are printers installed! 39。 No point in proceeding if not. 39。 If = 0 Then MsgBox No printers are installed. Can39。t continue., _ vbCritical, Fatal Error End End If End Sub Private Sub Form_Load() Dim prn As Printer 39。 39。 Fill bo box with available printers, and 39。 select default printer. 39。 For Each prn In Printers amp。 on amp。 Next prn 39。 39。 Select default printer. 39。 SelectDefaultPrinter Combo1 39。 39。 Size and position form。 clear textbox. 39。 With Me .Width = + * 2 + _ (.Width ) .Height = + + + _ (.Height .ScaleHeight) .Move ( .Width) \ 2, _ 電子科技大學畢業(yè)論文 家庭式 ERP系統(tǒng)分析與設計 34 ( .Height) \ 2 End With txtFile = End Sub 家庭上網(wǎng)模塊代碼 Sub Navigate_Text() 39。Automatically loads the URLs in the textbox 39。so the page can directly load up as a default 39。setting. End Sub Private Sub cmdBack_Click() 39。This event finds the last page loaded in the 39。history file and loads it into the WebBrowser. 39。Sample Code provided by: Petroutsos 39。Sybex Mastering Vb6 On Error GoTo NoBack Exit Sub NoBack: MsgBox There is no Page to go back to! End Sub Private Sub cmdBack2_Click() 39。This event finds the last page loaded in the history 39。file and loads it into the second WebBrowser. On Error GoTo NoBackTwo Exit Sub NoBackTwo: MsgBox There is no Page to go back to! End Sub Private Sub cmdForward_Click() 39。This event takes the first Web Browser to the 39。previously loaded page after one has pressed the 39。first back button. On Error GoTo NoForward Exit Sub 電子科技大學畢業(yè)論文 家庭式 ERP系統(tǒng)分析與設計 35 NoForward: MsgBox There are no files to load here! End Sub Private Sub cmdForward2_Click() 39。This event takes the first WebBrowser to the 39。previously loaded page after one has pressed 39。the second back button. On Error GoTo NoForwardTwo Exit Sub NoForwardTwo: MsgBox There are no files to load here! End Sub Private Sub cmdHome_Click() 39。This event takes the first WebBrowser to the 39。Home Url set in Microsoft IE. End Sub Private Sub cmdHome2_Click() 39。This event takes the second WebBrowser to the 39。Home Url set in Microsoft IE. End Sub Private Sub cmdNavigateOne_Click() 39。This event Takes the web Browser(1) to the 39。URL Entered into the first text box. End Sub Private Sub cmdNavigateTwo_Click() 39。This event Takes the web Browser(2) to the URL 39。entered into the second text box. End Sub Private Sub cmdRefresh_Click() 39。This event Refresh WebBrowser1. End Sub Private Sub cmdRefresh2_Click() 39。This event Refreshes WebBrowser2. 電子科技大學畢業(yè)論文 家庭式 ERP系統(tǒng)分析與設計 36 End Sub Private Sub cmdSearch_Click() 39。This event Loads the specified search page into 39。WebBrowser1. On Error GoTo NoSearch Exit Sub NoSearch: MsgBox There is no search page to load End Sub Private Sub cmdSearch2_Click() 39。This event Loads the specified search page into 39。WebBrowser2. On Error GoTo NoSearchTwo Exit Sub NoSearchTwo: MsgBox There is no search page to load End Sub Private Sub cmdStop_Click() 39。This event Stops WebBrowser1 from 39。loading any more of the HTML document. End Sub Private Sub cmdStop2_Click() 39。This event Stops WebBrowser2 from loading any 39。more of the HTML document. End Sub Private Sub Form_Load() 39。Centers the form in the screen by determining 39。the user39。s screen and video card resolution. 39。Greg Perry Sams Teach Yourself VB6 in 24 hrs. = ( ) / 2 = ( ) / 2 Navigate_Text End Sub 電子科技大學畢業(yè)論文 家庭式 ERP系統(tǒng)分析與設計 37 Private Sub mnuExit_Click() 39。Closes and ends the program. Unload Me End Sub Private Sub txtAddress1_DblClick() 39。When you double click the Text box, 39。it clears the text. = End Sub Private Sub txtAddress2_DblClick() 39。When you double click the Text box, it clears 39。the text. = End Sub