December 13th, 2011, 02:43 AM
Really need some help with the printing
hi iam new with vb and iam just trying to learn this one by reading tutorials online. After months of trying, i have created one db which i would like to use at our office. Its a counter Ticketing system. Its fun actually i must say, but its also giving me the headache with the trial and error am doing. Please, could someone help me. Attached is the print screen of my project.
I was able to make it work. Yes, it prints the number it needs to print. The problem is, instead of printing the next number, it only prints the number 1. here is the code that i used.
Please i really need help. I just really need to finish this project before the season of enrolment starts. Pleasee...Thank you so much in advance.
Public Class Form1
Dim iTicket As Integer
Dim ReturnString As String
iTicket = iTicket + 1
getTicket = iTicket
Private Sub Routine()
ReturnString = "Your number is " & getTicket().ToString
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
iTicket = 0
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("Please proceed at Counter 17.Your ticket is number " & getTicket())
MsgBox("Print your number?", MsgBoxStyle.YesNo)
If vbYes Then
ElseIf vbNo Then
Private Sub PrintDocument1_PrintPage(ByVal sender As System.Object, ByVal e As System.Drawing.Printing.PrintPageEventArgs) Handles PrintiTicket.PrintPage
e.Graphics.DrawString(ReturnString, TextBox1.Font, Brushes.Blue, 100, 100)
Private Sub buttonOnClick()
December 13th, 2011, 08:05 PM
Re: Really need some help with the printing
You are printing returnstring but you are not setting it in your getticket() routine.
You are setting it in your Routine() sub routine but you are not calling that routine.
Always use [code][/code] tags when posting code.
Click Here to Expand Forum to Full Width
This is a CodeGuru survey question.