form1.vb
来自「vb 应用实例 简单应用 dddddddddddddddddddddddddd」· VB 代码 · 共 145 行
VB
145 行
Imports System.IO
Imports System.Drawing.Printing
Public Class Form1
Inherits System.Windows.Forms.Form
#Region " Windows Form "
Public Sub New()
MyBase.New()
InitializeComponent()
End Sub
Protected Overloads Overrides Sub Dispose(ByVal disposing As Boolean)
If disposing Then
If Not (components Is Nothing) Then
components.Dispose()
End If
End If
MyBase.Dispose(disposing)
End Sub
Private components As System.ComponentModel.IContainer
Friend WithEvents Button1 As System.Windows.Forms.Button
Friend WithEvents TextBox1 As System.Windows.Forms.TextBox
Friend WithEvents Button2 As System.Windows.Forms.Button
Friend WithEvents Button3 As System.Windows.Forms.Button
Friend WithEvents Button4 As System.Windows.Forms.Button
Friend WithEvents OpenFileDialog1 As System.Windows.Forms.OpenFileDialog
Friend WithEvents SaveFileDialog1 As System.Windows.Forms.SaveFileDialog
Friend WithEvents FontDialog1 As System.Windows.Forms.FontDialog
Friend WithEvents ColorDialog1 As System.Windows.Forms.ColorDialog
Friend WithEvents PrintDialog1 As System.Windows.Forms.PrintDialog
Friend WithEvents PrintPreviewDialog1 As System.Windows.Forms.PrintPreviewDialog
Friend WithEvents PageSetupDialog1 As System.Windows.Forms.PageSetupDialog
Friend WithEvents Button5 As System.Windows.Forms.Button
Friend WithEvents Button6 As System.Windows.Forms.Button
Friend WithEvents Button7 As System.Windows.Forms.Button
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.Button1 = New System.Windows.Forms.Button()
Me.TextBox1 = New System.Windows.Forms.TextBox()
Me.Button2 = New System.Windows.Forms.Button()
Me.Button3 = New System.Windows.Forms.Button()
Me.Button4 = New System.Windows.Forms.Button()
Me.OpenFileDialog1 = New System.Windows.Forms.OpenFileDialog()
Me.SaveFileDialog1 = New System.Windows.Forms.SaveFileDialog()
Me.FontDialog1 = New System.Windows.Forms.FontDialog()
Me.ColorDialog1 = New System.Windows.Forms.ColorDialog()
Me.PrintDialog1 = New System.Windows.Forms.PrintDialog()
Me.PrintPreviewDialog1 = New System.Windows.Forms.PrintPreviewDialog()
Me.PageSetupDialog1 = New System.Windows.Forms.PageSetupDialog()
Me.Button5 = New System.Windows.Forms.Button()
Me.Button6 = New System.Windows.Forms.Button()
Me.Button7 = New System.Windows.Forms.Button()
Me.SuspendLayout()
'
'Button1
'
Me.Button1.Location = New System.Drawing.Point(358, 16)
Me.Button1.Name = "Button1"
Me.Button1.Size = New System.Drawing.Size(154, 24)
Me.Button1.TabIndex = 0
Me.Button1.Text = "打开文本文件"
'
'TextBox1
'
Me.TextBox1.Location = New System.Drawing.Point(20, 16)
Me.TextBox1.Multiline = True
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.Size = New System.Drawing.Size(318, 256)
Me.TextBox1.TabIndex = 1
Me.TextBox1.Text = ""
'
'Button2
'
Me.Button2.Location = New System.Drawing.Point(358, 48)
Me.Button2.Name = "Button2"
Me.Button2.Size = New System.Drawing.Size(154, 24)
Me.Button2.TabIndex = 2
Me.Button2.Text = "存储文本文件"
'
'Button3
'
Me.Button3.Location = New System.Drawing.Point(358, 112)
Me.Button3.Name = "Button3"
Me.Button3.Size = New System.Drawing.Size(154, 24)
Me.Button3.TabIndex = 3
Me.Button3.Text = "颜色"
'
'Button4
'
Me.Button4.Location = New System.Drawing.Point(358, 144)
Me.Button4.Name = "Button4"
Me.Button4.Size = New System.Drawing.Size(154, 24)
Me.Button4.TabIndex = 4
Me.Button4.Text = "字体"
'
'OpenFileDialog1
'
'
'SaveFileDialog1
'
Me.SaveFileDialog1.FileName = "doc1"
'
'PrintPreviewDialog1
'
Me.PrintPreviewDialog1.AutoScrollMargin = New System.Drawing.Size(0, 0)
Me.PrintPreviewDialog1.AutoScrollMinSize = New System.Drawing.Size(0, 0)
Me.PrintPreviewDialog1.ClientSize = New System.Drawing.Size(400, 300)
Me.PrintPreviewDialog1.Enabled = True
Me.PrintPreviewDialog1.Icon = CType(resources.GetObject("PrintPreviewDialog1.Icon"), System.Drawing.Icon)
Me.PrintPreviewDialog1.Location = New System.Drawing.Point(17, 54)
Me.PrintPreviewDialog1.MaximumSize = New System.Drawing.Size(0, 0)
Me.PrintPreviewDialog1.Name = "PrintPreviewDialog1"
Me.PrintPreviewDialog1.Opacity = 1
Me.PrintPreviewDialog1.TransparencyKey = System.Drawing.Color.Empty
Me.PrintPreviewDialog1.Visible = False
'
'Button5
'
Me.Button5.Location = New System.Drawing.Point(358, 184)
Me.Button5.Name = "Button5"
Me.Button5.Size = New System.Drawing.Size(154, 24)
Me.Button5.TabIndex = 5
Me.Button5.Text = "打印"
'
'Button6
'
Me.Button6.Location = New System.Drawing.Point(358, 216)
Me.Button6.Name = "Button6"
Me.Button6.Size = New System.Drawing.Size(154, 24)
Me.Button6.TabIndex = 6
Me.Button6.Text = "设置打印格式"
'
'Button7
'
Me.Button7.Location = New System.Drawing.Point(358, 248)
Me.Button7.Name = "Button7"
Me.Button7.Size = New System.Drawing.Size(154, 24)
Me.Button7.TabIndex = 7
Me.Button7.Text = "打印预览
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?