Public Class Form1 Private Declare Function PrintWindow Lib "User32" (ByVal hWnd As IntPtr, ByVal hdcBlt As IntPtr, ByVal nFlags As Integer) As Boolean Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click '▼コピー対象領域の幅と高さを計算 'WebBrowserコントロールのスクロールバーを除いた領域の計算方法がわからなかったので仮。 Dim clientWidth As Integer = WebBrowser1.Size.Width - SystemInformation.VerticalScrollBarWidth Dim clientHeight As Integer = WebBrowser1.Size.Height - SystemInformation.HorizontalScrollBarHeight '▼一時的な画像保存領域を確保 Dim image As New Bitmap(clientWidth, clientHeight) '▼WebBrowserコントロールからimage変数に画像をコピー Using targetGraphics As Graphics = Graphics.FromImage(image) Dim hDC As IntPtr = targetGraphics.GetHdc() PrintWindow(WebBrowser1.Handle, hDC, 0) targetGraphics.ReleaseHdc(hDC) End Using '▼image変数の内容をファイルに保存 image.Save("C:\vb\webbrowser.bmp") image.Dispose() End Sub Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load WebBrowser1.Navigate("http://www.nifty.com/") End Sub End Class