Mesothelioma Cancer
Your Ad Here

Wednesday, July 30, 2008

Sunday, July 20, 2008

DOT NET



webbrowser Source code

step 1 :

Create a project choose vb in that window application and name it as Web Browser

step2 :

1.Drag a Menu strip

i. Name the menu as File and Edit

I. In file create sub menus &New , &Open , &Save , &Exit

II. In Edit menu Create a sub menu name as &properties

2.Drag a panel from the Container tool box and set The Dock properti (f4 to view the properties) Down

3. Drag a tool strip menu and choose the label or image (if image give the path of the image in properties option) in toolstrip menu choose the text box name it as WebAddress

choose the DOCK propertie to Top

4. Drag a web Browser and set The Dock Propertie to Center

Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
'WebBrowser1.Navigate("www.google.com")
ToolStripProgressBar1.Minimum = 0
ToolStripProgressBar1.Value = 0
WebAddress.Focus()
End Sub

Private Sub WebBrowser1_DocumentTitleChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.DocumentTitleChanged
Me.Text = "Rajender" & " " & WebBrowser1.DocumentTitle
End Sub

Private Sub WebBrowser1_Navigated(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserNavigatedEventArgs) Handles WebBrowser1.Navigated
WebAddress.Text = WebBrowser1.Url.ToString
End Sub

Private Sub WebBrowser1_NewWindow(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) Handles WebBrowser1.NewWindow

End Sub

Private Sub WebBrowser1_ProgressChanged(ByVal sender As Object, ByVal e As System.Windows.Forms.WebBrowserProgressChangedEventArgs) Handles WebBrowser1.ProgressChanged
If (ToolStripProgressBar1.Value <= e.MaximumProgress) Then
ToolStripProgressBar1.Value = ToolStripProgressBar1.Value + e.CurrentProgress
End If
End Sub

Private Sub WebBrowser1_StatusTextChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebBrowser1.StatusTextChanged
ToolStripStatusLabel1.Text = WebBrowser1.StatusText
End Sub

Private Sub ToolStripButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton4.Click
WebBrowser1.Navigate(WebAddress.Text)

End Sub

Private Sub WebAddress_DoubleClick(ByVal sender As Object, ByVal e As System.EventArgs) Handles WebAddress.DoubleClick
WebAddress.SelectAll()
End Sub

Private Sub WebAddress_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles WebAddress.KeyDown
Dim address As String
'MsgBox(e.Modifiers & " " & e.KeyData)
Select Case e.KeyData
Case Keys.Enter
If Not WebAddress.Text.StartsWith("http:\\") Then
address = "http:\\" & WebAddress.Text
WebBrowser1.Navigate(New Uri(address))
End If
End Select
End Sub


Private Sub ToolStripButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ToolStripButton3.Click
WebBrowser1.Navigate("vishnu-inf.blogspot.com")
End Sub

Your Ad Here