locked
Printing a receipt for my payment RRS feed

  • Question

  • You just charged my annual fee of $99, but I cannot figure how to print a simple receipt on your mighty website, I despise wasting my precious time for something that should be as easy as 2-3 click of the mouse

    Please either send a receipt or directions

    Monday, October 10, 2016 4:43 PM

Answers

  • You just charged my annual fee of $99, but I cannot figure how to print a simple receipt on your mighty website, I despise wasting my precious time for something that should be as easy as 2-3 click of the mouse

    Please either send a receipt or directions

    .

    Option Strict On
    
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Printing
    
    Public Class Form1
    
        Private WithEvents PrintDocument1 As PrintDocument = New PrintDocument
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
        End Sub
    
        Private Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
            PrintDocument1.Print()
        End Sub
    
        Private Sub Print_Image_PrintPage(sender As Object, e As System.Drawing.Printing.PrintPageEventArgs)
            e.Graphics.DrawWebPage(WebPageImage, e.PageSettings.HardMarginX, e.PageSettings.HardMarginY)
        End Sub
    
    End Class


    La vida loca

    • Proposed as answer by Neda Zhang Friday, October 14, 2016 2:03 AM
    • Marked as answer by Neda Zhang Tuesday, October 18, 2016 1:52 AM
    Monday, October 10, 2016 6:13 PM
  • You just charged my annual fee of $99, but I cannot figure how to print a simple receipt on your mighty website, I despise wasting my precious time for something that should be as easy as 2-3 click of the mouse

    Please either send a receipt or directions

    I don't know what to say other than how sorry I am for your predicament. Perhaps if you pay the fee again, you can get a receipt. Try this:

    Module Module1
        Sub Main()
            Dim answer As String = "N"
            Console.Clear()
            Do
                Console.Write("Thanks for the Payment. Did you get a receipt (Y/N)")
                answer = Console.ReadLine.ToUpper
            Loop Until answer = "Y"
        End Sub
    End Module
    

    • Proposed as answer by Neda Zhang Friday, October 14, 2016 2:03 AM
    • Marked as answer by Neda Zhang Tuesday, October 18, 2016 1:52 AM
    Monday, October 10, 2016 10:18 PM

All replies

  • You just charged my annual fee of $99, but I cannot figure how to print a simple receipt on your mighty website

    Annual fee for what?

    This forum is for issues related to programming using Microsoft Visual Basic.
    There are no fees for using this or any other MSDN forum. You appear to have
    posted this thread to a wrong forum.

    - Wayne

    Monday, October 10, 2016 5:07 PM
  • You just charged my annual fee of $99, but I cannot figure how to print a simple receipt on your mighty website, I despise wasting my precious time for something that should be as easy as 2-3 click of the mouse

    Please either send a receipt or directions

    .

    Option Strict On
    
    Imports System.Drawing.Drawing2D
    Imports System.Drawing.Printing
    
    Public Class Form1
    
        Private WithEvents PrintDocument1 As PrintDocument = New PrintDocument
    
        Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            Me.Location = New Point(CInt((Screen.PrimaryScreen.WorkingArea.Width / 2) - (Me.Width / 2)), CInt((Screen.PrimaryScreen.WorkingArea.Height / 2) - (Me.Height / 2)))
        End Sub
    
        Private Sub btnPrint_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnPrint.Click
            PrintDocument1.Print()
        End Sub
    
        Private Sub Print_Image_PrintPage(sender As Object, e As System.Drawing.Printing.PrintPageEventArgs)
            e.Graphics.DrawWebPage(WebPageImage, e.PageSettings.HardMarginX, e.PageSettings.HardMarginY)
        End Sub
    
    End Class


    La vida loca

    • Proposed as answer by Neda Zhang Friday, October 14, 2016 2:03 AM
    • Marked as answer by Neda Zhang Tuesday, October 18, 2016 1:52 AM
    Monday, October 10, 2016 6:13 PM
  • You just charged my annual fee of $99, but I cannot figure how to print a simple receipt on your mighty website, I despise wasting my precious time for something that should be as easy as 2-3 click of the mouse

    Please either send a receipt or directions

    I don't know what to say other than how sorry I am for your predicament. Perhaps if you pay the fee again, you can get a receipt. Try this:

    Module Module1
        Sub Main()
            Dim answer As String = "N"
            Console.Clear()
            Do
                Console.Write("Thanks for the Payment. Did you get a receipt (Y/N)")
                answer = Console.ReadLine.ToUpper
            Loop Until answer = "Y"
        End Sub
    End Module
    

    • Proposed as answer by Neda Zhang Friday, October 14, 2016 2:03 AM
    • Marked as answer by Neda Zhang Tuesday, October 18, 2016 1:52 AM
    Monday, October 10, 2016 10:18 PM