Need help in Print Dialog (check boxes printing)

Musab

Member
Joined
Apr 9, 2008
Messages
21
Programming Experience
1-3
Hello,

I have been looking at some tutorials about using the print dialog, and I was able to print a text in a RichTextBox using the following code:

Printing in VB .NET - Print Dialog, PrintPreview Dialog, PrintPreview Sample Code Control, PageSetup Dialog

What I'm trying to do is print labels in my software, for exmaple

Name: NickName:
*Check Box1 *CheckBox2

so basically its a form and right now its working great, but 1 step is left is to make it print the label showing the checked chkBoxes and textboxes ..etc

Any Idea or a good tutorial will help. Thanks bunch !
 
Three options you can look into:
  • Control.DrawToBitmap
  • ControlPaint.DrawCheckBox
  • CheckBoxRenderer.DrawCheckBox
 
Another option is downloading VB.net powerpacks, and using the printform() function in it (very helpful). What it does is, it just prints the entire form with everything on it. What you can do to get the results you want is for example

'Say you wanted to print a word where a label is
Label1.text = "Blah" 'or Blah (where Blah is a saved string somewhere)

'Say you wanted to put the checkbox as checked, you just do this

checkbox1.checked = true
PrintForm()
checkbox1.checked = false

That way your checkbox is checked when you print, and unchecked when the printing is finished. Good luck, I hope that helped. Remember, Visual Basic .NET Powerpacks (3.0 or 2.0)
 
Back
Top