Click here to Skip to main content
15,892,643 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralRe: VB6 and VB.Net Pin
Q2gyro7-Feb-07 17:52
Q2gyro7-Feb-07 17:52 
AnswerRe: VB6 and VB.Net Pin
MatrixCoder7-Feb-07 8:17
MatrixCoder7-Feb-07 8:17 
AnswerRe: VB6 and VB.Net Pin
FeRtoll7-Feb-07 9:13
FeRtoll7-Feb-07 9:13 
AnswerRe: VB6 and VB.Net Pin
Dave Kreskowiak7-Feb-07 10:13
mveDave Kreskowiak7-Feb-07 10:13 
GeneralRe: VB6 and VB.Net Pin
matryxxx8-Feb-07 6:20
matryxxx8-Feb-07 6:20 
GeneralRe: VB6 and VB.Net Pin
Dave Kreskowiak8-Feb-07 14:23
mveDave Kreskowiak8-Feb-07 14:23 
QuestionPrinting Component Advice Pin
Jason Baggett7-Feb-07 6:09
Jason Baggett7-Feb-07 6:09 
AnswerRe: Printing Component Advice Pin
xstoneheartx7-Feb-07 13:18
xstoneheartx7-Feb-07 13:18 
here is an easy way:

Dim bm As New Bitmap(Me.Width, Me.Height)
Dim g As Graphics = Graphics.FromImage(bm)
Me.DrawToBitmap(bm, New Rectangle(0, 0, Me.Width, Me.Height))

now you can customize this code to getting a bitmap that only contain client rectangle of your form.

another way is:
Public Class ScreenCapture
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function GetDesktopWindow() As IntPtr
End Function
<System.Runtime.InteropServices.DllImport("user32.dll")> _
Private Shared Function GetWindowDC(ByVal hwnd As IntPtr) As IntPtr
End Function
<System.Runtime.InteropServices.DllImport("gdi32.dll")> _
Private Shared Function BitBlt(ByVal hDestDC As IntPtr, ByVal x As Integer, ByVal y As Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal hSrcDC As IntPtr, ByVal xSrc As Integer, ByVal ySrc As Integer, ByVal dwRop As System.Int32) As UInt64
End Function
'Save the screen capture into a jpg
Public Shared Function SaveScreen() As Bitmap
Dim myImage = New Bitmap(Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height)
Dim gr1 As Graphics = Graphics.FromImage(myImage)
Dim dc1 As IntPtr = gr1.GetHdc()
Dim dc2 As IntPtr = ScreenCapture.GetWindowDC(ScreenCapture.GetDesktopWindow())
ScreenCapture.BitBlt(dc1, 0, 0, Screen.PrimaryScreen.Bounds.Width, Screen.PrimaryScreen.Bounds.Height, dc2, 0, 0, 13369376)
gr1.ReleaseHdc(dc1)
Return myImage
End Function 'SaveScreen
End Class 'NativeMethods
GeneralRe: Printing Component Advice [modified] Pin
Jason Baggett8-Feb-07 3:28
Jason Baggett8-Feb-07 3:28 
QuestionDisplaying data from a database. Pin
jady847-Feb-07 4:52
jady847-Feb-07 4:52 
AnswerRe: Displaying data from a database. Pin
Colin Angus Mackay7-Feb-07 4:58
Colin Angus Mackay7-Feb-07 4:58 
GeneralRe: Displaying data from a database. Pin
jady847-Feb-07 5:14
jady847-Feb-07 5:14 
AnswerRe: Displaying data from a database. Pin
Polymorpher7-Feb-07 9:40
Polymorpher7-Feb-07 9:40 
QuestionReporting Problem Pin
Sarfaraj Ahmed7-Feb-07 3:06
Sarfaraj Ahmed7-Feb-07 3:06 
QuestionHow we can use split method in vb.net Pin
saravanaks6-Feb-07 22:45
saravanaks6-Feb-07 22:45 
AnswerRe: How we can use split method in vb.net Pin
Johan Hakkesteegt7-Feb-07 2:09
Johan Hakkesteegt7-Feb-07 2:09 
NewsRe: How we can use split method in vb.net Pin
FeRtoll7-Feb-07 9:53
FeRtoll7-Feb-07 9:53 
QuestionHow can i draw a rectangle in windows form Pin
saravanaks6-Feb-07 22:12
saravanaks6-Feb-07 22:12 
AnswerRe: How can i draw a rectangle in windows form Pin
andre_swnpl7-Feb-07 2:25
andre_swnpl7-Feb-07 2:25 
QuestionSource Code for Rental Equipment Pin
Member 38037806-Feb-07 21:42
Member 38037806-Feb-07 21:42 
AnswerRe: Source Code for Rental Equipment Pin
Guffa6-Feb-07 21:51
Guffa6-Feb-07 21:51 
Questionplease help me Pin
ozeyvarun6-Feb-07 21:35
ozeyvarun6-Feb-07 21:35 
AnswerRe: please help me Pin
Daytona_6756-Feb-07 22:07
Daytona_6756-Feb-07 22:07 
AnswerRe: please help me Pin
FeRtoll7-Feb-07 9:16
FeRtoll7-Feb-07 9:16 
Questionwebbrowser Pin
noki16-Feb-07 21:11
noki16-Feb-07 21:11 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.