📄 form1.vb
字号:
Option Strict Off
Option Explicit On
Friend Class Form1
Inherits System.Windows.Forms.Form
#Region "Windows 窗体设计器生成的代码"
Public Sub New()
MyBase.New()
If m_vb6FormDefInstance Is Nothing Then
If m_InitializingDefInstance Then
m_vb6FormDefInstance = Me
Else
Try
'对于启动窗体,所创建的第一个实例为默认实例。
If System.Reflection.Assembly.GetExecutingAssembly.EntryPoint.DeclaringType Is Me.GetType Then
m_vb6FormDefInstance = Me
End If
Catch
End Try
End If
End If
'此调用是 Windows 窗体设计器所必需的。
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
'Windows 窗体设计器所必需的
Public ToolTip1 As System.Windows.Forms.ToolTip
Public WithEvents Timer1 As System.Windows.Forms.Timer
Public WithEvents WebBrowser1 As AxSHDocVw.AxWebBrowser
Public WithEvents Picture1 As System.Windows.Forms.PictureBox
Public WithEvents Label1 As System.Windows.Forms.Label
'注意:以下过程是 Windows 窗体设计器所必需的
'可以使用 Windows 窗体设计器来修改它。
'不要使用代码编辑器来修改它。
<System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()
Me.components = New System.ComponentModel.Container()
Dim resources As System.Resources.ResourceManager = New System.Resources.ResourceManager(GetType(Form1))
Me.ToolTip1 = New System.Windows.Forms.ToolTip(Me.components)
Me.Label1 = New System.Windows.Forms.Label()
Me.Timer1 = New System.Windows.Forms.Timer(Me.components)
Me.WebBrowser1 = New AxSHDocVw.AxWebBrowser()
Me.Picture1 = New System.Windows.Forms.PictureBox()
CType(Me.WebBrowser1, System.ComponentModel.ISupportInitialize).BeginInit()
Me.SuspendLayout()
'
'Label1
'
Me.Label1.BackColor = System.Drawing.Color.Transparent
Me.Label1.Cursor = System.Windows.Forms.Cursors.Default
Me.Label1.ForeColor = System.Drawing.SystemColors.ControlText
Me.Label1.Location = New System.Drawing.Point(104, 16)
Me.Label1.Name = "Label1"
Me.Label1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Label1.Size = New System.Drawing.Size(648, 473)
Me.Label1.TabIndex = 2
Me.Label1.Text = "Label1"
'
'Timer1
'
Me.Timer1.Enabled = True
Me.Timer1.Interval = 200
'
'WebBrowser1
'
Me.WebBrowser1.Enabled = True
Me.WebBrowser1.Location = New System.Drawing.Point(840, 88)
Me.WebBrowser1.OcxState = CType(resources.GetObject("WebBrowser1.OcxState"), System.Windows.Forms.AxHost.State)
Me.WebBrowser1.Size = New System.Drawing.Size(192, 88)
Me.WebBrowser1.TabIndex = 0
'
'Picture1
'
Me.Picture1.BackColor = System.Drawing.SystemColors.Control
Me.Picture1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D
Me.Picture1.Cursor = System.Windows.Forms.Cursors.Default
Me.Picture1.ForeColor = System.Drawing.SystemColors.ControlText
Me.Picture1.Location = New System.Drawing.Point(0, 88)
Me.Picture1.Name = "Picture1"
Me.Picture1.RightToLeft = System.Windows.Forms.RightToLeft.No
Me.Picture1.Size = New System.Drawing.Size(1032, 664)
Me.Picture1.TabIndex = 1
Me.Picture1.TabStop = False
'
'Form1
'
Me.AutoScaleBaseSize = New System.Drawing.Size(6, 14)
Me.ClientSize = New System.Drawing.Size(1028, 747)
Me.Controls.AddRange(New System.Windows.Forms.Control() {Me.WebBrowser1, Me.Picture1, Me.Label1})
Me.Location = New System.Drawing.Point(4, 29)
Me.Name = "Form1"
Me.Text = "Form1"
Me.WindowState = System.Windows.Forms.FormWindowState.Maximized
CType(Me.WebBrowser1, System.ComponentModel.ISupportInitialize).EndInit()
Me.ResumeLayout(False)
End Sub
#End Region
#Region "升级支持"
Private Shared m_vb6FormDefInstance As Form1
Private Shared m_InitializingDefInstance As Boolean
Public Shared Property DefInstance() As Form1
Get
If m_vb6FormDefInstance Is Nothing OrElse m_vb6FormDefInstance.IsDisposed Then
m_InitializingDefInstance = True
m_vb6FormDefInstance = New Form1()
m_InitializingDefInstance = False
End If
DefInstance = m_vb6FormDefInstance
End Get
Set
m_vb6FormDefInstance = Value
End Set
End Property
#End Region
Dim aa As String
Private Sub Form1_Load(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles MyBase.Load
Picture1.Image = System.Drawing.Image.FromFile("f:\sunmengning\libo8.bmp")
WebBrowser1.Navigate(("f:\cat3.gif"))
aa = " 这 是 一 个 利 用 网 络 浏 览 器IE 中WebBrowser 控 件 制 作 的GIF 动 画 播 放 程 序。 "
Label1.ForeColor = System.Drawing.ColorTranslator.FromOle(QBColor(11))
Label1.Font = VB6.FontChangeSize(Label1.Font, 18)
Label1.Text = aa
End Sub
Private Sub Picture1_Click(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Picture1.Click
Me.Close()
End Sub
Private Sub Timer1_Tick(ByVal eventSender As System.Object, ByVal eventArgs As System.EventArgs) Handles Timer1.Tick
' 让字符串头尾相接,以便形成滚动效果。
aa = Mid(aa, 2, 59) & Mid(aa, 1)
Label1.Text = aa
End Sub
End Class
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -