⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 form1.vb

📁 编程之道VB.NETt程序设计入门-589M.zip
💻 VB
字号:
Public Class Form1
    Inherits System.Windows.Forms.Form

#Region " Windows 窗体设计器生成的代码 "

    Public Sub New()
        MyBase.New()

        '该调用是 Windows 窗体设计器所必需的。
        InitializeComponent()

        '在 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

    'Windows 窗体设计器所必需的
    Private components As System.ComponentModel.IContainer

    '注意:以下过程是 Windows 窗体设计器所必需的
    '可以使用 Windows 窗体设计器修改此过程。
    '不要使用代码编辑器修改它。
    Friend WithEvents picOuter As System.Windows.Forms.PictureBox
    Friend WithEvents picInner As System.Windows.Forms.PictureBox
    Friend WithEvents hsbPic As System.Windows.Forms.HScrollBar
    Friend WithEvents vsbPic As System.Windows.Forms.VScrollBar
    <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
        Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
        Me.picOuter = New System.Windows.Forms.PictureBox()
        Me.picInner = New System.Windows.Forms.PictureBox()
        Me.hsbPic = New System.Windows.Forms.HScrollBar()
        Me.vsbPic = New System.Windows.Forms.VScrollBar()
        Me.SuspendLayout()
        '
        'picOuter
        '
        Me.picOuter.Location = New System.Drawing.Point(8, 8)
        Me.picOuter.Name = "picOuter"
        Me.picOuter.Size = New System.Drawing.Size(512, 312)
        Me.picOuter.TabIndex = 0
        Me.picOuter.TabStop = False
        '
        'picInner
        '
        Me.picInner.Image = CType(resources.GetObject("picInner.Image"), System.Drawing.Bitmap)
        Me.picInner.Location = New System.Drawing.Point(144, 64)
        Me.picInner.Name = "picInner"
        Me.picInner.Size = New System.Drawing.Size(176, 120)
        Me.picInner.TabIndex = 1
        Me.picInner.TabStop = False
        '
        'hsbPic
        '
        Me.hsbPic.Location = New System.Drawing.Point(0, 320)
        Me.hsbPic.Name = "hsbPic"
        Me.hsbPic.Size = New System.Drawing.Size(520, 17)
        Me.hsbPic.TabIndex = 2
        '
        'vsbPic
        '
        Me.vsbPic.Location = New System.Drawing.Point(520, 0)
        Me.vsbPic.Name = "vsbPic"
        Me.vsbPic.Size = New System.Drawing.Size(17, 320)
        Me.vsbPic.TabIndex = 3
        '
        'Form1
        '
        Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
        Me.ClientSize = New System.Drawing.Size(552, 350)
        Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.vsbPic, Me.hsbPic, Me.picInner, Me.picOuter})
        Me.Name = "Form1"
        Me.Text = "Form1"
        Me.ResumeLayout(False)

    End Sub

#End Region

    Private Sub vsbPic_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles vsbPic.Scroll
        picInner.Top = -(vsbPic.Value)
    End Sub

    Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        picOuter.Controls.Add(picInner)
        picInner.Left = 0
        picInner.Top = 0
        picInner.SizeMode = PictureBoxSizeMode.AutoSize

        vsbPic.Maximum = picInner.Height - picOuter.Height
        hsbPic.Maximum = picInner.Width - picOuter.Width
    End Sub

    Private Sub hsbPic_Scroll(ByVal sender As System.Object, ByVal e As System.Windows.Forms.ScrollEventArgs) Handles hsbPic.Scroll
        picInner.Left = -(hsbPic.Value)
    End Sub
End Class

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -