Results 1 to 7 of 7

Thread: print in dos mode

  1. #1
    mailtojis is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Sep 2012
    Posts
    3
    Reputation
    0

    Exclamation print in dos mode

    Please help me to creating a bill and print using dos mode in my vb.net application.
    I use a dot matrix printer.

  2. #2
    IanRyder is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Sep 2012
    Location
    Healing, NE Lincs, UK
    Posts
    1,089
    Reputation
    715
    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.

  3. #3
    mailtojis is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Sep 2012
    Posts
    3
    Reputation
    0

    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.
    Attached Files Attached Files

  4. #4
    IanRyder is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Sep 2012
    Location
    Healing, NE Lincs, UK
    Posts
    1,089
    Reputation
    715
    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.

  5. #5
    IanRyder is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Sep 2012
    Location
    Healing, NE Lincs, UK
    Posts
    1,089
    Reputation
    715
    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.


    Code:
    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
    Attached Files Attached Files

  6. #6
    mailtojis is offline VB.NET Forum Newbie
    .NET Framework
    .NET 3.5
    Join Date
    Sep 2012
    Posts
    3
    Reputation
    0

    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

  7. #7
    IanRyder is offline VB.NET Forum All-Mighty
    .NET Framework
    .NET 4.0
    Join Date
    Sep 2012
    Location
    Healing, NE Lincs, UK
    Posts
    1,089
    Reputation
    715
    Hi,

    I have not actually tried to use the classes that you posted myself, so I cannot help here. What I can do is point you to the site of the developer who discusses his class. See here:-

    Articles by Antonino Porcino (Articles: 2, Tip/Trick: 1) - CodeProject

    Cheers,

    Ian

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Harvest time tracking