Vb.net打字源码 vbs输入文字( 二 )


End Sub
Private Sub Form_Resize()
Form1.Text1.Width = Form1.Width - 130
Form1.Text1.Height = Form1.Height
End Sub
Private Sub help1Menu_Click()
Form1.CommonDialog1.HelpCommand = cdlHelpForceFile
Form1.CommonDialog1.HelpFile = "c:\windows\system32\winhelp.hlp"
CommonDialog1.ShowHelp
End Sub
Private Sub newMenu_Click()
If Len(Trim(Text1.Text)) = 0 Then
Form1.Caption = "Vb.net打字源码我的记事本""--""未命名"
sFileName = "未命名"
Text1.FontSize = 15
Text1.FontName = "宋体"
Text1.Text = ""
Else
Call saveAsMenu_Click
Form1.Caption = "Vb.net打字源码我的记事本""--""未命名"
sFileName = "未命名"
Text1.FontSize = 15
Text1.FontName = "宋体"
Text1.Text = ""
End If
End Sub
Private Sub openMenu_Click()'打开文件代码
If Len(Trim(Text1.Text)) = 0 Then
Form1.Caption = "我的记事本"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 4096
Form1.CommonDialog1.Action = 1
If Len(Form1.CommonDialog1.FileName)0 Then
sFileName = Form1.CommonDialog1.FileName
Form1.Caption = Form1.Caption"--"Form1.CommonDialog1.FileTitle
Open sFileName For Input As #1
Text1.FontSize = 15
Text1.FontName = "宋体"
Do While Not EOF(1)
Line Input #1, Text$
All$ = All$ + Text$ + Chr(13) + Chr(10)
Loop
Text1.Text = All
Close #1
End If
Else
Call saveAsMenu_Click
Form1.Caption = "我的记事本"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 4096
Form1.CommonDialog1.Action = 1
If Len(Form1.CommonDialog1.FileName)0 Then
sFileName = Form1.CommonDialog1.FileName
Form1.Caption = Form1.Caption"--"Form1.CommonDialog1.FileTitle
Open sFileName For Input As #1
Text1.FontSize = 15
Text1.FontName = "宋体"
Do While Not EOF(1)
Line Input #1, Text$
All$ = All$ + Text$ + Chr(13) + Chr(10)
Loop
Text1.Text = All
Close #1
End If
End If
End Sub
Private Sub pasteMenu_Click()'粘贴菜单代码
Text1.Text = Left(Text1.Text, Text1.SelStart) + Clipboard.GetText() + Mid(Text1.Text, Text1.SelStart + Text1.SelLength + 1)
End Sub
Private Sub printMenu_Click()
Form1.CommonDialog1.ShowPrinter
For i = 1 To CommonDialog1.Copies
Printer.Print Text1.Text
Printer.Print Text1.Text
Next
Printer.EndDoc
End Sub
Private Sub saveAsMenu_Click()'另存为菜单代码
If Len(Trim(Text1.Text))0 Then
Form1.CommonDialog1.DialogTitle = "保存文件"
Form1.CommonDialog1.InitDir = "D:\"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 2
Form1.CommonDialog1.ShowSave
If Len(Form1.CommonDialog1.FileName)0 Then
sFileName = Form1.CommonDialog1.FileName
Open sFileName For Output As #1
whole$ = Text1.Text
Print #1, whole
Close #1
End If
End If
End Sub
Private Sub saveMenu_Click()
If Len(Trim(Text1.Text))0 Then
Form1.CommonDialog1.DialogTitle = "保存文件"
Form1.CommonDialog1.InitDir = "D:\"
Form1.CommonDialog1.FileName = "新建文本"
Form1.CommonDialog1.Filter = "文本文件|*.txt"
Form1.CommonDialog1.Flags = 2
Form1.CommonDialog1.ShowSave
If Len(Form1.CommonDialog1.FileName)0 Then
sFileName = Form1.CommonDialog1.FileName
Open sFileName For Output As #1
whole$ = Text1.Text
Print #1, whole
Close #1
End If
End If
End Sub
Private Sub statusMenu_Click()
End Sub
哪位大师有VB.NET编写的快递单打印源代码提供参考一下,十分感谢?。。?/h2>用vba编写快递单打印模板的源代码是很长的,因为用Excel打印快递单是个系统工程!

推荐阅读