print in dos mode

mailtojis

New member
Joined
Sep 16, 2012
Messages
3
Programming Experience
Beginner
Please help me to creating a bill and print using dos mode in my vb.net application.
I use a dot matrix printer.
 
Hi,

On the basis that you are writing a VB.NET application am I right in assuming that you are writing a Windows Forms application which needs to print to a Dot Matrix Printer?

If so, then your best bet is to create a Printer object through your Windows Control Panel using the Generic / Text windows printer driver. You will then be able to access your printer through the standard VB printing objects that are available to you in the Visual Studio development interface. If not, then sorry, I have not developed in DOS for over 20 years.

Hope that helps.

Cheers,

Ian.
 
Print Problem in dotmatrix

HI ian,
Thank u for your reply..But i am a fresher in vb.net .I heard about doing the above problem by creating a printing class.I Got the code for the same in c#.I attached the same bellow.Can u please help me to convert it into vb.net.This code helps me to print fast.
 

Attachments

  • print.txt
    5.1 KB · Views: 113
  • lprint.txt
    8.1 KB · Views: 94
Hi,

Had a quick look just now and it already looks like it has been convetred to VB? I will take some time later today to dig into the code and see what I can do.

I will come back to you later.

Cheers

Ian.
 
Hi,

I have now converted your two text files to two VB classes that you can use in your application. There was no conversion necessary since these were already written in VB. I have also added a class diagram so that you can easily visualise the properties and methods of each of the classes.

To use the classes, save the attached ZIP file and extract the 3 VB files to your computer. Then, in your application choose Add, Existing Item and add the 3 files to your application. You can then access the classes using the following declarations in your code. Remember to change " WindowsApplication1" to you own application name.


VB.NET:
Imports WindowsApplication1.FAMILYSHOPPINGCENTER
 
Public Class Form1
 
  Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
    Dim LP As New LPrinter
    Dim PC As New PrintClass
  End Sub
End Class
Hope this helps.

Good Luck,

Ian
 

Attachments

  • PrintClass.zip
    4.2 KB · Views: 143
printing problem

hi Ian,


Thanks for ur support andd sorry for big gap.
Anyway i did what u mentioned in last reply.But there is a problem..I didn't find any errors.but ha ' HandlePrinter ' value always shows 0 or false.But the code detect the
correct printer name..Sorry sir ,Actually i am a beginner level programmer.And i don't know what are the correct steps for calling functions from the forms.My main 2 doubts are .For correct printing ,what methods are i need to call in the class like printer class and lprinter
or any other things i want to do for the corrrect execution of this.



sir ,can u give an example of pojects in vb.net using these classes and just passing 2 or three strings and printing it,instead of dataset.Then i will try to do the same,




Thaanking you
JISA
 
Back
Top