Private Sub InitializeComponent()
Dim resources As System.ComponentModel.ComponentResourceManager = New System.ComponentModel.ComponentResourceManager(GetType(Form1))
Me.ToolStrip1 = New System.Windows.Forms.ToolStrip
Me.WebBrowser1 = New System.Windows.Forms.WebBrowser
Me.ToolStripTextBox1 = New System.Windows.Forms.ToolStripTextBox
Me.ToolStripButton1 = New System.Windows.Forms.ToolStripButton
Me.ToolStripSplitButton1 = New System.Windows.Forms.ToolStripSplitButton
Me.ToolStripMenuItem1 = New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripMenuItem2 = New System.Windows.Forms.ToolStripMenuItem
Me.ToolStripMenuItem3 = New System.Windows.Forms.ToolStripMenuItem
Me.ToolStrip1.SuspendLayout()
Me.SuspendLayout()
'
'ToolStrip1
'
Me.ToolStrip1.Items.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripSplitButton1, Me.ToolStripTextBox1, Me.ToolStripButton1})
Me.ToolStrip1.Location = New System.Drawing.Point(0, 0)
Me.ToolStrip1.Name = "ToolStrip1"
Me.ToolStrip1.Size = New System.Drawing.Size(1292, 25)
Me.ToolStrip1.TabIndex = 0
Me.ToolStrip1.Text = "ToolStrip1"
'
'WebBrowser1
'
Me.WebBrowser1.Dock = System.Windows.Forms.DockStyle.Fill
Me.WebBrowser1.Location = New System.Drawing.Point(0, 25)
Me.WebBrowser1.MinimumSize = New System.Drawing.Size(20, 20)
Me.WebBrowser1.Name = "WebBrowser1"
Me.WebBrowser1.Size = New System.Drawing.Size(1292, 762)
Me.WebBrowser1.TabIndex = 1
'
'ToolStripTextBox1
'
Me.ToolStripTextBox1.Name = "ToolStripTextBox1"
Me.ToolStripTextBox1.Size = New System.Drawing.Size(500, 25)
'
'ToolStripButton1
'
Me.ToolStripButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.ToolStripButton1.Image = CType(resources.GetObject("ToolStripButton1.Image"), System.Drawing.Image)
Me.ToolStripButton1.ImageTransparentColor = System.Drawing.Color.Magenta
Me.ToolStripButton1.Name = "ToolStripButton1"
Me.ToolStripButton1.Size = New System.Drawing.Size(23, 22)
Me.ToolStripButton1.Text = "ToolStripButton1"
'
'ToolStripSplitButton1
'
Me.ToolStripSplitButton1.DisplayStyle = System.Windows.Forms.ToolStripItemDisplayStyle.Image
Me.ToolStripSplitButton1.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ToolStripMenuItem1, Me.ToolStripMenuItem2, Me.ToolStripMenuItem3})
Me.ToolStripSplitButton1.Image = CType(resources.GetObject("ToolStripSplitButton1.Image"), System.Drawing.Image)
Me.ToolStripSplitButton1.ImageTransparentColor = System.Drawing.Color.Magenta
Me.ToolStripSplitButton1.Name = "ToolStripSplitButton1"
Me.ToolStripSplitButton1.Size = New System.Drawing.Size(32, 22)
Me.ToolStripSplitButton1.Text = "ToolStripSplitButton1"
'
'ToolStripMenuItem1
'
Me.ToolStripMenuItem1.Name = "ToolStripMenuItem1"
Me.ToolStripMenuItem1.Size = New System.Drawing.Size(196, 22)
Me.ToolStripMenuItem1.Text = "MSN"
'
'ToolStripMenuItem2
'
Me.ToolStripMenuItem2.Name = "ToolStripMenuItem2"
Me.ToolStripMenuItem2.Size = New System.Drawing.Size(196, 22)
Me.ToolStripMenuItem2.Text = "史萊姆論壇"
'
'ToolStripMenuItem3
'
Me.ToolStripMenuItem3.Name = "ToolStripMenuItem3"
Me.ToolStripMenuItem3.Size = New System.Drawing.Size(196, 22)
Me.ToolStripMenuItem3.Text = "中央氣象局全球資訊網"
'
'Form1
'
Me.AutoScaleDimensions = New System.Drawing.SizeF(6.0!, 12.0!)
Me.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font
Me.ClientSize = New System.Drawing.Size(1292, 787)
Me.Controls.Add(Me.WebBrowser1)
Me.Controls.Add(Me.ToolStrip1)
Me.Name = "Form1"
Me.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen
Me.Text = "Form1"
Me.ToolStrip1.ResumeLayout(False)
Me.ToolStrip1.PerformLayout()
Me.ResumeLayout(False)
Me.PerformLayout()
End Sub
Friend WithEvents ToolStrip1 As System.Windows.Forms.ToolStrip
Friend WithEvents WebBrowser1 As System.Windows.Forms.WebBrowser
Friend WithEvents ToolStripTextBox1 As System.Windows.Forms.ToolStripTextBox
Friend WithEvents ToolStripButton1 As System.Windows.Forms.ToolStripButton
Friend WithEvents ToolStripSplitButton1 As System.Windows.Forms.ToolStripSplitButton
Friend WithEvents ToolStripMenuItem1 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripMenuItem2 As System.Windows.Forms.ToolStripMenuItem
Friend WithEvents ToolStripMenuItem3 As System.Windows.Forms.ToolStripMenuItem
Public Class Form1
Public Declare Function GetPrivateProfileString Lib "kernel32" _
Alias "GetPrivateProfileStringA" ( _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpApplicationName As String, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpKeyName As String, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpDefault As String, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpReturnedString As StringBuilder, _
ByVal nSize As UInt32, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpFileName As String) As UInt32
Public Declare Function WritePrivateProfileString Lib "kernel32" _
Alias "WritePrivateProfileStringA" ( _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpApplicationName As String, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpKeyName As String, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpReturnedString As StringBuilder, _
<MarshalAs(UnmanagedType.LPStr)> ByVal lpFileName As String) As UInt32
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Dim sSection As String = "Url"
Dim sKey As String = "Default"
Dim sKeyValue As New StringBuilder(512)
Dim nSize As UInt32 = Convert.ToUInt32(512)
Dim sinifilename As String = My.Computer.FileSystem.CurrentDirectory & "\QuitSaveINI.ini"
ToolStripTextBox1.Text = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", Nothing)
GetPrivateProfileString(sSection, sKey, "", sKeyValue, nSize, sinifilename)
If sKeyValue.ToString <> "" Then ToolStripTextBox1.Text = sKeyValue.ToString
WebBrowser1.Navigate(ToolStripTextBox1.Text)
End Sub
Private Sub Form1_FormClosed(ByVal sender As System.Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles MyBase.FormClosed
Dim lReturnLen As UInt32
Dim sSection As String = "Url"
Dim sKey As String = "Default"
Dim sKeyValue As New StringBuilder(512)
Dim nSize As UInt32 = Convert.ToUInt32(512)
Dim sinifilename As String = My.Computer.FileSystem.CurrentDirectory & "\QuitSaveINI.ini"
sKeyValue = sKeyValue.Append(ToolStripTextBox1.Text)
lReturnLen = WritePrivateProfileString(sSection, sKey, sKeyValue, sinifilename)
End Sub
Private Sub ToolStripButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton1.Click
WebBrowser1.Navigate(ToolStripTextBox1.Text)
End Sub
Private Sub ToolStripSplitButton1_ButtonClick(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripSplitButton1.ButtonClick
ToolStripTextBox1.Text = My.Computer.Registry.GetValue("HKEY_CURRENT_USER\Software\Microsoft\Internet Explorer\Main", "Start Page", Nothing)
ToolStripButton1_Click(sender, e)
End Sub
Private Sub ToolStripMenuItem1_Click_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem1.Click
ToolStripTextBox1.Text = "http://tw.msn.com/"
ToolStripButton1_Click(sender, e)
End Sub
Private Sub ToolStripMenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem2.Click
ToolStripTextBox1.Text = "http://forum.slime.com.tw"
ToolStripButton1_Click(sender, e)
End Sub
Private Sub ToolStripMenuItem3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripMenuItem3.Click
ToolStripTextBox1.Text = "http://www.cwb.gov.tw/"
ToolStripButton1_Click(sender, e)
End Sub
End Class