Click here to Skip to main content
15,921,959 members
Home / Discussions / Visual Basic
   

Visual Basic

 
General.NET - How to merge Header and Cell in Grid Pin
hoanhnd23-Dec-04 17:06
hoanhnd23-Dec-04 17:06 
GeneralRe: .NET - How to merge Header and Cell in Grid Pin
Dave Kreskowiak26-Dec-04 14:29
mveDave Kreskowiak26-Dec-04 14:29 
QuestionHow to track mouse and keyboard activities using vb.net Pin
Philip Low23-Dec-04 15:20
Philip Low23-Dec-04 15:20 
AnswerRe: How to track mouse and keyboard activities using vb.net Pin
jackiepct23-Dec-04 21:07
jackiepct23-Dec-04 21:07 
GeneralRe: How to track mouse and keyboard activities using vb.net Pin
Philip Low23-Dec-04 22:55
Philip Low23-Dec-04 22:55 
GeneralRe: How to track mouse and keyboard activities using vb.net Pin
jackiepct23-Dec-04 22:59
jackiepct23-Dec-04 22:59 
GeneralRe: How to track mouse and keyboard activities using vb.net Pin
Philip Low27-Dec-04 18:46
Philip Low27-Dec-04 18:46 
GeneralPrint Preview error Pin
Shrex23-Dec-04 11:37
Shrex23-Dec-04 11:37 
ok I figured out how to print a form but not yet a label, but it prints a form, i'm having problems with Print Preview now, i get the following error

Value cannot be null
Parameter name: image.

------------------------------------------------------------
here is the code i used

Imports System.Drawing.Printing
Public Class form1
Inherits System.Windows.Forms.Form


Private Declare Function BitBlt Lib "gdi32.dll" Alias "BitBlt" (ByVal _
hdcDest As IntPtr, ByVal nXDest As Integer, ByVal nYDest As _
Integer, ByVal nWidth As Integer, ByVal nHeight As Integer, ByVal _
hdcSrc As IntPtr, ByVal nXSrc As Integer, ByVal nYSrc As Integer, _
ByVal dwRop As System.Int32) As Long
Dim memoryImage As Bitmap
Private Sub CaptureScreen()
Dim mygraphics As Graphics = Me.CreateGraphics()
Dim s As Size = Me.Size
memoryImage = New Bitmap(s.Width, s.Height, mygraphics)
Dim memoryGraphics As Graphics = Graphics.FromImage(memoryImage)
Dim dc1 As IntPtr = mygraphics.GetHdc
Dim dc2 As IntPtr = memoryGraphics.GetHdc
BitBlt(dc2, 0, 0, Me.ClientRectangle.Width, _
Me.ClientRectangle.Height, dc1, 0, 0, 13369376)
mygraphics.ReleaseHdc(dc1)
memoryGraphics.ReleaseHdc(dc2)
End Sub
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles _
PrintDocument1.PrintPage
e.Graphics.DrawImage(memoryImage, 0, 0)
End Sub
Private Sub mnuPrint_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles mnuPrint.Click
CaptureScreen()
End Sub
Private Sub mnuPrintPreview_Click(ByVal sender As System.Object, ByVal e As _
System.EventArgs) Handles mnuPrintpreview.Click
PrintPreviewDialog1.Document = PrintDocument1
PrintPreviewDialog1.Show()

End Sub
GeneralConnecting one program with other Pin
_Bulldog_23-Dec-04 8:05
_Bulldog_23-Dec-04 8:05 
GeneralRe: Connecting one program with other Pin
Dave Kreskowiak23-Dec-04 16:30
mveDave Kreskowiak23-Dec-04 16:30 
GeneralVB Timer Problem Pin
soonfah23-Dec-04 7:50
soonfah23-Dec-04 7:50 
GeneralRe: VB Timer Problem Pin
_Bulldog_23-Dec-04 8:16
_Bulldog_23-Dec-04 8:16 
GeneralGathering Performance Data using VB.NET Pin
iown71423-Dec-04 5:53
iown71423-Dec-04 5:53 
GeneralRe: Gathering Performance Data using VB.NET Pin
Dave Kreskowiak23-Dec-04 16:28
mveDave Kreskowiak23-Dec-04 16:28 
GeneralRe: Gathering Performance Data using VB.NET Pin
Siegfried Geisler24-Dec-04 1:08
Siegfried Geisler24-Dec-04 1:08 
GeneralVB 6.0 IDE Problems Pin
Justin Cooke23-Dec-04 5:51
Justin Cooke23-Dec-04 5:51 
GeneralRe: VB 6.0 IDE Problems Pin
Nicholas Cardi23-Dec-04 10:24
Nicholas Cardi23-Dec-04 10:24 
GeneralRe: VB 6.0 IDE Problems Pin
Steven Campbell23-Dec-04 16:24
Steven Campbell23-Dec-04 16:24 
GeneralRe: VB 6.0 IDE Problems Pin
Dave Kreskowiak23-Dec-04 16:25
mveDave Kreskowiak23-Dec-04 16:25 
GeneralMDI child get maximized if any other child is maximized Pin
Rizwan Bashir22-Dec-04 22:32
Rizwan Bashir22-Dec-04 22:32 
GeneralRe: MDI child get maximized if any other child is maximized Pin
Dave Kreskowiak23-Dec-04 16:22
mveDave Kreskowiak23-Dec-04 16:22 
GeneralRe: MDI child get maximized if any other child is maximized Pin
Rizwan Bashir25-Dec-04 21:57
Rizwan Bashir25-Dec-04 21:57 
QuestionSendMessage to the parent of a control? Pin
TAlvord22-Dec-04 9:59
TAlvord22-Dec-04 9:59 
GeneralConnection to database through config file Pin
ccotton33322-Dec-04 9:55
ccotton33322-Dec-04 9:55 
GeneralRe: Connection to database through config file Pin
T Manjaly6-Jan-05 13:50
T Manjaly6-Jan-05 13:50 

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.