Click here to Skip to main content
16,005,121 members
Home / Discussions / Visual Basic
   

Visual Basic

 
GeneralPlease help me.... Pin
KORCARI27-Sep-04 10:35
KORCARI27-Sep-04 10:35 
GeneralRe: Please help me.... Pin
Colin Angus Mackay27-Sep-04 11:42
Colin Angus Mackay27-Sep-04 11:42 
GeneralRe: Please help me.... Pin
Christian Graus27-Sep-04 12:10
protectorChristian Graus27-Sep-04 12:10 
GeneralRe: Please help me.... Pin
Desi Bravo27-Sep-04 19:41
Desi Bravo27-Sep-04 19:41 
GeneralRe: Please help me.... Pin
Colin Angus Mackay28-Sep-04 4:32
Colin Angus Mackay28-Sep-04 4:32 
QuestionHow to Enable Print option Pin
eshban28427-Sep-04 10:12
eshban28427-Sep-04 10:12 
AnswerRe: How to Enable Print option Pin
McClamm27-Sep-04 11:10
McClamm27-Sep-04 11:10 
AnswerRe: How to Enable Print option Pin
Desi Bravo27-Sep-04 19:31
Desi Bravo27-Sep-04 19:31 
Actually the print is complex, but also as easy it comes. Depends what you really want to do with the print option. Like he said, in MS Word is more advanced and complex. It has a lot of coding using the Do..Loop, IF..Then...Else statements, as well as the With conditions for every loop that a counter encounters when a user clicks on the print button.

But there is a very simple code that you may use momentarily, just to get the gist of coding print documents.
This is the code that I developed that is much easier if I want to print non-complex applications. I used this to print the database information that fills the dataset in a datagrid. The connection I used is Access Database(Microsoft Jet) and the OleDbDataAdapter. It prints fine without exception.

All you need is a print button. Call it printGrid.

Private Sub btnPrintGrid_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnPrintGrid.Click
PrintDocument1.Print()
End Sub

Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, _
ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles _
PrintDocument1.PrintPage
Dim myPaintArgs As New PaintEventArgs(e.Graphics, New Rectangle(New _
Point(0, 0), Me.Size))
Me.InvokePaint(DataGrid1, myPaintArgs)
End Sub

bravo659
Generalattching events to xML menus in ASP.NET/VB.NET Pin
Mahee Zeenath27-Sep-04 9:06
Mahee Zeenath27-Sep-04 9:06 
GeneralRe: attching events to xML menus in ASP.NET/VB.NET Pin
Dave Kreskowiak27-Sep-04 17:32
mveDave Kreskowiak27-Sep-04 17:32 
GeneralVBA Event handling Pin
macmac3827-Sep-04 5:25
macmac3827-Sep-04 5:25 
GeneralRe: VBA Event handling Pin
Dave Kreskowiak27-Sep-04 6:26
mveDave Kreskowiak27-Sep-04 6:26 
Generalvb.net calendar control Pin
nazerudeen27-Sep-04 4:57
nazerudeen27-Sep-04 4:57 
GeneralRe: vb.net calendar control Pin
Dave Kreskowiak27-Sep-04 6:12
mveDave Kreskowiak27-Sep-04 6:12 
QuestionHow to detect changes in datagrids row Pin
Edong26-Sep-04 21:55
Edong26-Sep-04 21:55 
GeneralIssueVision Pin
progload26-Sep-04 16:44
progload26-Sep-04 16:44 
GeneralRe: IssueVision - Clickety Pin
Dave Kreskowiak27-Sep-04 3:19
mveDave Kreskowiak27-Sep-04 3:19 
GeneralRe: IssueVision - Clickety Pin
progload27-Sep-04 6:56
progload27-Sep-04 6:56 
GeneralRe: IssueVision - Clickety Pin
Dave Kreskowiak27-Sep-04 7:18
mveDave Kreskowiak27-Sep-04 7:18 
GeneralRe: IssueVision Pin
Steven Campbell27-Sep-04 4:35
Steven Campbell27-Sep-04 4:35 
GeneralRe: IssueVision Pin
progload27-Sep-04 7:06
progload27-Sep-04 7:06 
GeneralCreating an MDI child Pin
Verolix26-Sep-04 15:42
Verolix26-Sep-04 15:42 
GeneralRe: Creating an MDI child Pin
Nick Seng26-Sep-04 16:20
Nick Seng26-Sep-04 16:20 
GeneralRe: Creating an MDI child Pin
Verolix27-Sep-04 15:54
Verolix27-Sep-04 15:54 
GeneralRe: Creating an MDI child Pin
Desi Bravo27-Sep-04 19:54
Desi Bravo27-Sep-04 19:54 

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.