📄 selectfile.vb
字号:
Me.Command1.TextAlign = System.Drawing.ContentAlignment.MiddleCenter
Me.Command1.Text = "确定(&O)"
Me.AcceptButton = Me.Command1
Me.Command1.Enabled = False
Me.Command1.Size = New System.Drawing.Size(92, 26)
Me.Command1.Location = New System.Drawing.Point(228, 22)
Me.Command1.TabIndex = 5
Me.Command1.BackColor = System.Drawing.SystemColors.Control
Me.Command1.CausesValidation = True
Me.Command1.ForeColor = System.Drawing.SystemColors.ControlText
Me.Command1.Cursor = System.Windows.Forms.Cursors.Default
Me.Command1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Command1.TabStop = True
Me.Command1.Name = "Command1"
Me.Drive1.Size = New System.Drawing.Size(149, 20)
Me.Drive1.Location = New System.Drawing.Point(181, 234)
Me.Drive1.TabIndex = 3
Me.Drive1.BackColor = System.Drawing.SystemColors.Window
Me.Drive1.CausesValidation = True
Me.Drive1.Enabled = True
Me.Drive1.ForeColor = System.Drawing.SystemColors.WindowText
Me.Drive1.Cursor = System.Windows.Forms.Cursors.Default
Me.Drive1.TabStop = True
Me.Drive1.Visible = True
Me.Drive1.Name = "Drive1"
Me.Dir1.Size = New System.Drawing.Size(149, 118)
Me.Dir1.Location = New System.Drawing.Point(181, 105)
Me.Dir1.TabIndex = 4
Me.Dir1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Dir1.BackColor = System.Drawing.SystemColors.Window
Me.Dir1.CausesValidation = True
Me.Dir1.Enabled = True
Me.Dir1.ForeColor = System.Drawing.SystemColors.WindowText
Me.Dir1.Cursor = System.Windows.Forms.Cursors.Default
Me.Dir1.TabStop = True
Me.Dir1.Visible = True
Me.Dir1.Name = "Dir1"
Me.Text1.AutoSize = False
Me.Text1.Size = New System.Drawing.Size(155, 18)
Me.Text1.Location = New System.Drawing.Point(12, 47)
Me.Text1.ReadOnly = True
Me.Text1.TabIndex = 0
Me.Text1.AcceptsReturn = True
Me.Text1.TextAlign = System.Windows.Forms.HorizontalAlignment.Left
Me.Text1.BackColor = System.Drawing.SystemColors.Window
Me.Text1.CausesValidation = True
Me.Text1.Enabled = True
Me.Text1.ForeColor = System.Drawing.SystemColors.WindowText
Me.Text1.HideSelection = True
Me.Text1.Maxlength = 0
Me.Text1.Cursor = System.Windows.Forms.Cursors.IBeam
Me.Text1.MultiLine = False
Me.Text1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Text1.ScrollBars = System.Windows.Forms.ScrollBars.None
Me.Text1.TabStop = True
Me.Text1.Visible = True
Me.Text1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Text1.Name = "Text1"
Me.Line9.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me.Line9.Visible = True
Me.Line9.Location = New System.Drawing.Point(354, 12)
Me.Line9.Width = 196
Me.Line9.Height = 1
Me.Line9.Name = "Line9"
Me.Line8.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me.Line8.Visible = True
Me.Line8.Location = New System.Drawing.Point(354, 12)
Me.Line8.Width = 1
Me.Line8.Height = 244
Me.Line8.Name = "Line8"
Me.Line7.BackColor = System.Drawing.Color.White
Me.Line7.Visible = True
Me.Line7.Location = New System.Drawing.Point(550, 12)
Me.Line7.Width = 1
Me.Line7.Height = 245
Me.Line7.Name = "Line7"
Me.Line6.BackColor = System.Drawing.Color.White
Me.Line6.Visible = True
Me.Line6.Location = New System.Drawing.Point(355, 256)
Me.Line6.Width = 195
Me.Line6.Height = 1
Me.Line6.Name = "Line6"
Me._Line5_1.BackColor = System.Drawing.Color.White
Me._Line5_1.Visible = True
Me._Line5_1.Location = New System.Drawing.Point(166, 13)
Me._Line5_1.Width = 1
Me._Line5_1.Height = 26
Me._Line5_1.Name = "_Line5_1"
Me._Line5_0.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me._Line5_0.Visible = True
Me._Line5_0.Location = New System.Drawing.Point(12, 13)
Me._Line5_0.Width = 1
Me._Line5_0.Height = 26
Me._Line5_0.Name = "_Line5_0"
Me._Line4_1.BackColor = System.Drawing.Color.White
Me._Line4_1.Visible = True
Me._Line4_1.Location = New System.Drawing.Point(13, 39)
Me._Line4_1.Width = 154
Me._Line4_1.Height = 1
Me._Line4_1.Name = "_Line4_1"
Me._Line4_0.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me._Line4_0.Visible = True
Me._Line4_0.Location = New System.Drawing.Point(12, 12)
Me._Line4_0.Width = 154
Me._Line4_0.Height = 1
Me._Line4_0.Name = "_Line4_0"
Me._Line3_2.BackColor = System.Drawing.Color.FromARGB(224, 224, 224)
Me._Line3_2.Visible = True
Me._Line3_2.Location = New System.Drawing.Point(2, 2)
Me._Line3_2.Width = 1
Me._Line3_2.Height = 261
Me._Line3_2.Name = "_Line3_2"
Me._Line2_2.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me._Line2_2.Visible = True
Me._Line2_2.Location = New System.Drawing.Point(556, 3)
Me._Line2_2.Width = 1
Me._Line2_2.Height = 262
Me._Line2_2.Name = "_Line2_2"
Me._Line2_0.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me._Line2_0.Visible = True
Me._Line2_0.Location = New System.Drawing.Point(1, 1)
Me._Line2_0.Width = 1
Me._Line2_0.Height = 263
Me._Line2_0.Name = "_Line2_0"
Me._Line1_0.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me._Line1_0.Visible = True
Me._Line1_0.Location = New System.Drawing.Point(1, 1)
Me._Line1_0.Width = 556
Me._Line1_0.Height = 1
Me._Line1_0.Name = "_Line1_0"
Me._Line1_1.BackColor = System.Drawing.Color.FromARGB(224, 224, 224)
Me._Line1_1.Visible = True
Me._Line1_1.Location = New System.Drawing.Point(1, 2)
Me._Line1_1.Width = 555
Me._Line1_1.Height = 1
Me._Line1_1.Name = "_Line1_1"
Me._Line1_2.BackColor = System.Drawing.Color.FromARGB(224, 224, 224)
Me._Line1_2.Visible = True
Me._Line1_2.Location = New System.Drawing.Point(0, 265)
Me._Line1_2.Width = 557
Me._Line1_2.Height = 1
Me._Line1_2.Name = "_Line1_2"
Me._Line1_3.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me._Line1_3.Visible = True
Me._Line1_3.Location = New System.Drawing.Point(1, 264)
Me._Line1_3.Width = 555
Me._Line1_3.Height = 1
Me._Line1_3.Name = "_Line1_3"
Me._Line3_0.BackColor = System.Drawing.Color.FromARGB(224, 224, 224)
Me._Line3_0.Visible = True
Me._Line3_0.Location = New System.Drawing.Point(557, 2)
Me._Line3_0.Width = 1
Me._Line3_0.Height = 264
Me._Line3_0.Name = "_Line3_0"
Me._Line2_1.BackColor = System.Drawing.Color.FromARGB(128, 128, 128)
Me._Line2_1.Visible = True
Me._Line2_1.Location = New System.Drawing.Point(348, 2)
Me._Line2_1.Width = 1
Me._Line2_1.Height = 261
Me._Line2_1.Name = "_Line2_1"
Me._Line3_1.BackColor = System.Drawing.Color.FromARGB(224, 224, 224)
Me._Line3_1.Visible = True
Me._Line3_1.Location = New System.Drawing.Point(349, 2)
Me._Line3_1.Width = 1
Me._Line3_1.Height = 261
Me._Line3_1.Name = "_Line3_1"
Me.Label1.Text = "选定的文件名称及路径"
Me.Label1.ForeColor = System.Drawing.Color.FromARGB(0, 0, 128)
Me.Label1.Size = New System.Drawing.Size(120, 12)
Me.Label1.Location = New System.Drawing.Point(29, 21)
Me.Label1.TabIndex = 9
Me.Label1.TextAlign = System.Drawing.ContentAlignment.TopLeft
Me.Label1.BackColor = System.Drawing.SystemColors.Control
Me.Label1.Enabled = True
Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label1.UseMnemonic = True
Me.Label1.Visible = True
Me.Label1.AutoSize = True
Me.Label1.BorderStyle = System.Windows.Forms.BorderStyle.None
Me.Label1.Name = "Label1"
Me.MenuEdit.Text = "编辑"
Me.MenuEdit.Checked = False
Me.MenuEdit.Enabled = True
Me.MenuEdit.Visible = True
Me.MenuEdit.MDIList = False
Me.DelFile.Text = "删除(&D)"
Me.DelFile.Shortcut = System.Windows.Forms.Shortcut.CtrlD
Me.DelFile.Checked = False
Me.DelFile.Enabled = True
Me.DelFile.Visible = True
Me.DelFile.MDIList = False
Me.Controls.Add(picUP)
Me.Controls.Add(picDown)
Me.Controls.Add(Check2)
Me.Controls.Add(Picture1)
Me.Controls.Add(Check1)
Me.Controls.Add(SelectType)
Me.Controls.Add(File1)
Me.Controls.Add(Command2)
Me.Controls.Add(Command1)
Me.Controls.Add(Drive1)
Me.Controls.Add(Dir1)
Me.Controls.Add(Text1)
Me.Controls.Add(Line9)
Me.Controls.Add(Line8)
Me.Controls.Add(Line7)
Me.Controls.Add(Line6)
Me.Controls.Add(_Line5_1)
Me.Controls.Add(_Line5_0)
Me.Controls.Add(_Line4_1)
Me.Controls.Add(_Line4_0)
Me.Controls.Add(_Line3_2)
Me.Controls.Add(_Line2_2)
Me.Controls.Add(_Line2_0)
Me.Controls.Add(_Line1_0)
Me.Controls.Add(_Line1_1)
Me.Controls.Add(_Line1_2)
Me.Controls.Add(_Line1_3)
Me.Controls.Add(_Line3_0)
Me.Controls.Add(_Line2_1)
Me.Controls.Add(_Line3_1)
Me.Controls.Add(Label1)
Me.Picture1.Controls.Add(Command3)
Me.Picture1.Controls.Add(HScroll1)
Me.Picture1.Controls.Add(VScroll1)
Me.Picture1.Controls.Add(DisplayPicture)
Me.Line1.SetIndex(_Line1_0, CType(0, Short))
Me.Line1.SetIndex(_Line1_1, CType(1, Short))
Me.Line1.SetIndex(_Line1_2, CType(2, Short))
Me.Line1.SetIndex(_Line1_3, CType(3, Short))
Me.Line2.SetIndex(_Line2_2, CType(2, Short))
Me.Line2.SetIndex(_Line2_0, CType(0, Short))
Me.Line2.SetIndex(_Line2_1, CType(1, Short))
Me.Line3.SetIndex(_Line3_2, CType(2, Short))
Me.Line3.SetIndex(_Line3_0, CType(0, Short))
Me.Line3.SetIndex(_Line3_1, CType(1, Short))
Me.Line4.SetIndex(_Line4_1, CType(1, Short))
Me.Line4.SetIndex(_Line4_0, CType(0, Short))
Me.Line5.SetIndex(_Line5_1, CType(1, Short))
Me.Line5.SetIndex(_Line5_0, CType(0, Short))
CType(Me.Line5, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Line4, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Line3, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Line2, System.ComponentModel.ISupportInitialize).EndInit()
CType(Me.Line1, System.ComponentModel.ISupportInitialize).EndInit()
Me.MenuEdit.Index = 0
MainMenu1.MenuItems.AddRange(New System.Windows.Forms.MenuItem(){Me.MenuEdit})
Me.DelFile.Index = 0
MenuEdit.MenuItems.AddRange(New System.Windows.Forms.MenuItem(){Me.DelFile})
Me.Menu = MainMenu1
End Sub
#End Region
#Region "升级支持"
Private Shared m_vb6FormDefInstance As SelectFile
Private Shared m_InitializingDefInstance As Boolean
Public Shared Property DefInstance() As SelectFile
Get
If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
m_InitializingDefInstance = True
m_vb6FormDefInstance = New SelectFile()
m_InitializingDefInstance = False
End If
DefInstance = m_vb6FormDefInstance
End Get
Set
m_vb6FormDefInstance = Value
End Set
End Property
#End Region
Dim Mx, Sx, Sy, My As Integer
Dim LB As Boolean
'UPGRADE_WARNING: 初始化窗体时可能激发事件 Check1.CheckStateChanged。 单击以获得更多信息:'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup2075"'
Private Sub Check1_CheckStateChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Check1.CheckStateChanged
If Check1.CheckState = 1 Then
SelectFile.DefInstance.Width = VB6.TwipsToPixelsX(8475)
Else
SelectFile.DefInstance.Width = VB6.TwipsToPixelsX(5355)
DisplayPicture.Image = Nothing
Exit Sub
End If
If Text1.Text <> "" Then
SelectFile.DefInstance.Cursor = System.Windows.Forms.Cursors.WaitCursor
On Error GoTo NOp
If Check2.CheckState = 1 Then
DisplayPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.Normal
Else
DisplayPicture.Height = VB6.TwipsToPixelsY(3645)
DisplayPicture.Width = VB6.TwipsToPixelsX(2925)
DisplayPicture.SizeMode = System.Windows.Forms.PictureBoxSizeMode.StretchImage
End If
DisplayPicture.Image = System.Drawing.Image.FromFile(Text1.Text)
'Large photo display
If Check2.CheckState = 1 Then
HScroll1.Value = 0
VScroll1.Value = 0
HScroll1.Maximum = (VB6.PixelsToTwipsX(DisplayPicture.Width) - VB6.PixelsToTwipsX(Picture1.Width) + 280 + HScroll1.LargeChange - 1)
VScroll1.Maximum = (VB6.PixelsToTwipsY(DisplayPicture.Height) - VB6.PixelsToTwipsY(Picture1.Height) + 280 + VScroll1.LargeChange - 1)
VScroll1.Visible = VB6.PixelsToTwipsY(Picture1.Height) < VB6.PixelsToTwipsY(DisplayPicture.Height)
HScroll1.Visible = VB6.PixelsToTwipsX(Picture1.Width) < VB6.PixelsToTwipsX(DisplayPicture.Width)
If HScroll1.Visible Or VScroll1.Visible Then
Command3.Visible = True
Else
Command3.Visible = False
End If
Else
VScroll1.Visible = False
HScroll1.Visible = False
Command3.Visible = False
End If
SelectFile.DefInstance.Cursor = System.Windows.Forms.Cursors.Default
End If
Exit Sub
NOp:
MsgBox("图片出错,不能浏览!", MsgBoxStyle.OKOnly + 16, "图片不能安装")
DisplayPicture.Image = Nothing
SelectFile.DefInstance.Cursor = System.Windows.Forms.Cursors.Default
Exit Sub
End Sub
'UPGRADE_WARNING: 初始化窗体时可能激发事件 Check2.CheckStateChanged。 单击以获得更多信息:'ms-help://MS.VSCC/commoner/redir/redirect.htm?keyword="vbup2075"'
Private Sub Check2_CheckStateChanged(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Check2.CheckStateChanged
On Error Resume Next
If Check1.CheckState = 1 Then
If Check2.CheckState = 1 Then
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -