How to Write a Program That Will Refresh Explorer

Written by jaime avelar
  • Share
  • Tweet
  • Share
  • Pin
  • Email
How to Write a Program That Will Refresh Explorer
Refresh your web browser using VB.NET. (http www image by mbs from Fotolia.com)

Refreshing Internet Explorer can make your Windows application more user-friendly. You can use Visual Basic.NET, also known as VB.NET, to accomplish this task. VB.NET is a computer language often used by programmers due to its flexibility and ease-of-use. Automatically refreshing your web browser can be very useful when you're monitoring information, such as social networks or news. In a few steps, you can create a VB.NET project that will refresh Internet Explorer with a click of a button.

Skill level:
Moderate

Other People Are Reading

Things you need

  • Microsoft Visual Basic Express

Show MoreHide

Instructions

  1. 1

    Start "Microsoft Visual Basic Express." Click "New Project..." on the left pane of your screen, then select "Windows Forms Application." Click "OK."

  2. 2

    Double-click "Button" on the "Toolbox" pane to add a new button control. Double-click "Button1" to open the "Form1.vb"module." Press "Ctrl" and "A," then "Delete" to remove all existing code.

  3. 3

    Click the Windows "Start" button, then select "Internet Explorer" to start your web browser.

  4. 4

    Copy and paste the code below into your "Form1.vb" module to refresh Internet Explorer:

    Public Class Form1

    Declare Function SetForegroundWindow Lib "user32" (ByVal hwnd As Integer) As Integer
    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
    
    
    
        For Each my Process As Process In Process.GetProcessesByName("IEXPLORE")
    
            SetForegroundWindow(myProcess.MainWindowHandle.ToInt32)
    
            SendKeys.Send("{F5}")
    
        Next
    
    
    
    End Sub
    

    End Class

  5. 5

    Press "F5," then click "Button1."

Don't Miss

Filter:
  • All types
  • Articles
  • Slideshows
  • Videos
Sort:
  • Most relevant
  • Most popular
  • Most recent

No articles available

No slideshows available

No videos available

By using the eHow.co.uk site, you consent to the use of cookies. For more information, please see our Cookie policy.