?? frmmain.vb
字號:
Option Strict Off
Option Explicit On
Friend Class frmMain
Inherits System.Windows.Forms.Form
#Region "Windows Form Designer generated code "
Public Sub New()
MyBase.New()
If m_vb6FormDefInstance Is Nothing Then
If m_InitializingDefInstance Then
m_vb6FormDefInstance = Me
Else
Try
'For the start-up form, the first instance created is the default instance.
If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
m_vb6FormDefInstance = Me
End If
Catch
End Try
End If
End If
'This call is required by the Windows Form Designer.
InitializeComponent()
End Sub
'Form overrides dispose to clean up the component list.
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
'Required by the Windows Form Designer
Private components As System.ComponentModel.IContainer
Public ToolTip1 As System.Windows.Forms.ToolTip
Public WithEvents FileFind As Microsoft.VisualBasic.Compatibility.VB6.FileListBox
Public WithEvents DirFind As Microsoft.VisualBasic.Compatibility.VB6.DirListBox
Public WithEvents DriveFind As Microsoft.VisualBasic.Compatibility.VB6.DriveListBox
Public WithEvents Command1 As System.Windows.Forms.Button
Public WithEvents txtRead As System.Windows.Forms.TextBox
Public WithEvents txtWrite As System.Windows.Forms.TextBox
Public WithEvents cmdRead As System.Windows.Forms.Button
Public WithEvents cmdWrite As System.Windows.Forms.Button
'NOTE: The following procedure is required by the Windows Form Designer
'It can be modified using the Windows Form Designer.
'Do not modify it using the code editor.
Public WithEvents TextBox1 As System.Windows.Forms.TextBox
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.FileFind = New Microsoft.VisualBasic.Compatibility.VB6.FileListBox
Me.DirFind = New Microsoft.VisualBasic.Compatibility.VB6.DirListBox
Me.DriveFind = New Microsoft.VisualBasic.Compatibility.VB6.DriveListBox
Me.Command1 = New System.Windows.Forms.Button
Me.txtRead = New System.Windows.Forms.TextBox
Me.txtWrite = New System.Windows.Forms.TextBox
Me.cmdRead = New System.Windows.Forms.Button
Me.cmdWrite = New System.Windows.Forms.Button
Me.TextBox1 = New System.Windows.Forms.TextBox
Me.SuspendLayout()
'
'FileFind
'
Me.FileFind.BackColor = System.Drawing.SystemColors.Window
Me.FileFind.Cursor = System.Windows.Forms.Cursors.Default
Me.FileFind.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.FileFind.ForeColor = System.Drawing.SystemColors.WindowText
Me.FileFind.Location = New System.Drawing.Point(248, 40)
Me.FileFind.Name = "FileFind"
Me.FileFind.Pattern = "*.*"
Me.FileFind.Size = New System.Drawing.Size(224, 144)
Me.FileFind.TabIndex = 7
'
'DirFind
'
Me.DirFind.BackColor = System.Drawing.SystemColors.Window
Me.DirFind.Cursor = System.Windows.Forms.Cursors.Default
Me.DirFind.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.DirFind.ForeColor = System.Drawing.SystemColors.WindowText
Me.DirFind.IntegralHeight = False
Me.DirFind.Location = New System.Drawing.Point(8, 64)
Me.DirFind.Name = "DirFind"
Me.DirFind.Size = New System.Drawing.Size(230, 126)
Me.DirFind.TabIndex = 6
'
'DriveFind
'
Me.DriveFind.BackColor = System.Drawing.SystemColors.Window
Me.DriveFind.Cursor = System.Windows.Forms.Cursors.Default
Me.DriveFind.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.DriveFind.ForeColor = System.Drawing.SystemColors.WindowText
Me.DriveFind.Location = New System.Drawing.Point(8, 40)
Me.DriveFind.Name = "DriveFind"
Me.DriveFind.Size = New System.Drawing.Size(228, 21)
Me.DriveFind.TabIndex = 5
'
'Command1
'
Me.Command1.BackColor = System.Drawing.SystemColors.Control
Me.Command1.Cursor = System.Windows.Forms.Cursors.Default
Me.Command1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Command1.ForeColor = System.Drawing.SystemColors.ControlText
Me.Command1.Location = New System.Drawing.Point(8, 240)
Me.Command1.Name = "Command1"
Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Command1.Size = New System.Drawing.Size(465, 25)
Me.Command1.TabIndex = 4
Me.Command1.Text = "Close"
'
'txtRead
'
Me.txtRead.AcceptsReturn = True
Me.txtRead.AutoSize = False
Me.txtRead.BackColor = System.Drawing.SystemColors.Window
Me.txtRead.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtRead.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtRead.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtRead.Location = New System.Drawing.Point(168, 200)
Me.txtRead.MaxLength = 0
Me.txtRead.Name = "txtRead"
Me.txtRead.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtRead.Size = New System.Drawing.Size(305, 25)
Me.txtRead.TabIndex = 3
Me.txtRead.Text = ""
'
'txtWrite
'
Me.txtWrite.AcceptsReturn = True
Me.txtWrite.AutoSize = False
Me.txtWrite.BackColor = System.Drawing.SystemColors.Window
Me.txtWrite.Cursor = System.Windows.Forms.Cursors.IBeam
Me.txtWrite.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.txtWrite.ForeColor = System.Drawing.SystemColors.WindowText
Me.txtWrite.Location = New System.Drawing.Point(168, 8)
Me.txtWrite.MaxLength = 0
Me.txtWrite.Name = "txtWrite"
Me.txtWrite.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.txtWrite.Size = New System.Drawing.Size(305, 25)
Me.txtWrite.TabIndex = 2
Me.txtWrite.Text = ""
'
'cmdRead
'
Me.cmdRead.BackColor = System.Drawing.SystemColors.Control
Me.cmdRead.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdRead.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdRead.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdRead.Location = New System.Drawing.Point(8, 200)
Me.cmdRead.Name = "cmdRead"
Me.cmdRead.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdRead.Size = New System.Drawing.Size(153, 25)
Me.cmdRead.TabIndex = 1
Me.cmdRead.Text = "Read Floppy A: to Image"
'
'cmdWrite
'
Me.cmdWrite.BackColor = System.Drawing.SystemColors.Control
Me.cmdWrite.Cursor = System.Windows.Forms.Cursors.Default
Me.cmdWrite.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.cmdWrite.ForeColor = System.Drawing.SystemColors.ControlText
Me.cmdWrite.Location = New System.Drawing.Point(8, 8)
Me.cmdWrite.Name = "cmdWrite"
Me.cmdWrite.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.cmdWrite.Size = New System.Drawing.Size(153, 25)
Me.cmdWrite.TabIndex = 0
Me.cmdWrite.Text = "Write Image to Floppy A:"
'
'TextBox1
'
Me.TextBox1.AcceptsReturn = True
Me.TextBox1.AutoSize = False
Me.TextBox1.BackColor = System.Drawing.SystemColors.Window
Me.TextBox1.Cursor = System.Windows.Forms.Cursors.IBeam
Me.TextBox1.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.TextBox1.ForeColor = System.Drawing.SystemColors.WindowText
Me.TextBox1.Location = New System.Drawing.Point(80, 272)
Me.TextBox1.MaxLength = 0
Me.TextBox1.Name = "TextBox1"
Me.TextBox1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.TextBox1.Size = New System.Drawing.Size(305, 25)
Me.TextBox1.TabIndex = 8
Me.TextBox1.Text = ""
'
'frmMain
'
Me.AutoScaleBaseSize = New System.Drawing.Size(5, 13)
Me.BackColor = System.Drawing.SystemColors.Control
Me.ClientSize = New System.Drawing.Size(477, 302)
Me.Controls.Add(Me.TextBox1)
Me.Controls.Add(Me.FileFind)
Me.Controls.Add(Me.DirFind)
Me.Controls.Add(Me.DriveFind)
Me.Controls.Add(Me.Command1)
Me.Controls.Add(Me.txtRead)
Me.Controls.Add(Me.txtWrite)
Me.Controls.Add(Me.cmdRead)
Me.Controls.Add(Me.cmdWrite)
Me.Cursor = System.Windows.Forms.Cursors.Default
Me.Font = New System.Drawing.Font("Arial", 8.0!, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, CType(0, Byte))
Me.Location = New System.Drawing.Point(4, 23)
Me.Name = "frmMain"
Me.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Text = "Form1"
Me.ResumeLayout(False)
End Sub
#End Region
#Region "Upgrade Support "
Private Shared m_vb6FormDefInstance As frmMain
Private Shared m_InitializingDefInstance As Boolean
Public Shared Property DefInstance() As frmMain
Get
If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
m_InitializingDefInstance = True
m_vb6FormDefInstance = New frmMain()
m_InitializingDefInstance = False
End If
DefInstance = m_vb6FormDefInstance
End Get
Set
m_vb6FormDefInstance = Value
End Set
End Property
#End Region
Public gsPath As String
Private Sub cmdRead_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdRead.Click
TextBox1.Text = "reading"
Call ReadFloppyToFile((txtRead.Text), "Label Name", True)
DirFind.Path = gsPath
End Sub
Private Sub cmdWrite_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles cmdWrite.Click
Call WriteImageToFloppy((txtWrite.Text), True)
DirFind_Change(DirFind, New System.EventArgs)
End Sub
Private Sub Command1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Command1.Click
End
End Sub
Private Sub DirFind_Change(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles DirFind.Change
FileFind.FileName = DirFind.Path
gsPath = DirFind.Path
End Sub
Private Sub DriveFind_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles DriveFind.SelectedIndexChanged
DirFind.Path = DriveFind.Drive
End Sub
Private Sub FileFind_SelectedIndexChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles FileFind.SelectedIndexChanged
' Dim Tmp As String
If FileFind.Items.Count > 0 Then
txtWrite.Text = DirFind.Path & "\" & FileFind.Items(FileFind.SelectedIndex)
cmdWrite.Enabled = True
End If
End Sub
Private Sub frmMain_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
frmMain.DefInstance.Text = "Image Tester"
txtRead.Text = VB6.GetPath & "\MyTestRead.imz"
'txtWrite.Text = App.Path & "\MyTestRead.imz"
FileFind.Pattern = "*.ima;*.imz"
DirFind.Path = VB6.GetPath
cmdWrite.Enabled = False
End Sub
'UPGRADE_WARNING: Event txtWrite.TextChanged may fire when form is initialized. Click for more: 'ms-help://MS.VSCC.2003/commoner/redir/redirect.htm?keyword="vbup2075"'
Private Sub txtWrite_TextChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles txtWrite.TextChanged
If txtWrite.Text = "" Then cmdWrite.Enabled = False
End Sub
End Class
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -