| |
|
If this is your first visit, be sure to check out the FAQ by clicking the link above.
You may have to register before you can post: click the register link above to proceed.
To start viewing messages, select the forum that you want to visit from the selection below.
|
 |
|

11-28-11, 21:47
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
|
|
are u asking for this one rocslide?
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox("You ticket is number " & getTicket())
End Sub
|
|

11-28-11, 21:55
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
|
|
Yep, that was the bit.... that is weird, there is nothing there that should exit the application.
Do you want to share the rest of the code you have?
Does it show the message box at all?
|
|

11-28-11, 22:03
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
|
|
the message box does not pop out rocslide. )=
am afraid i have no more code to share cause the only code ive been using is the one you gave me. I really have no idea what more to add on it. But this is whats on it.
Public Class Form1
Dim iTicket As Integer
Function getTicket()
iTicket = iTicket + 1
getTicket = iTicket
End
End Function
Private Sub TextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles TextBox1.TextChanged
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
buttonOnClick()
MsgBox("You ticket is number " & getTicket())
End Sub
Private Sub BackgroundWorker1_DoWork(ByVal sender As System.Object, ByVal e As System.ComponentModel.DoWorkEventArgs)
End Sub
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
iTicket = 0
End Sub
Private Sub buttonOnClick()
MsgBox("You ticket is number " & getTicket())
|
|

11-28-11, 22:06
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
|
|
no problems change this...
Code:
Function getTicket()
iTicket = iTicket + 1
getTicket = iTicket
End
End Function
to this
Code:
Function getTicket()
iTicket = iTicket + 1
getTicket = iTicket
End Function
The End before the end function is ending the execution of the application.
|
|

11-28-11, 22:25
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
rokslide, cool! it worked! haha.
But the problem is, its giving me two numbers at the same time. I mean, when i clicked the first button, a message box appeared and said that my ticket number is number 1. When i clicked ok, it gave me another msgbox saying that my number is number 2. What am thinking is that the second msgbox will ask me if i would like to print the first number it gave me?
Sorry rokslide for asking to much of your time and knowledge..I am very thankful of your help. (=
|
|

11-28-11, 22:36
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
|
|
Okie, have a look at the code you have.
You have an event handler for the button click event called Private Sub Button1_Click
So when the use clicks on the button this code fires.
In this code the first line that executes is buttonOnClick() when is another private sub routine you have declared further down in your code.
If you look at that sub routine it appears to do the same as your event handler.
This is why you are getting the same message twice.
Do you need help to sort out the second message box now that I have explained what is happening?
|
|

11-28-11, 23:49
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
rokslide thank u for that information. Really it made me smile finally understanding whats going on out there. I changed the second message box to "Would you like to print the number?" and it worked.
Would it be to much if i ask again how can i print the number? (=. Thank you so much.
|
|

11-29-11, 16:01
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
|
|
To be honest I don't know, it has been ages since I worked with VB and when I did printing from it we normally used a reporting tool such as crystal reports.
You should be able to find a tutorial on it though via a google search
|
|

11-30-11, 18:18
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
hi rokslide.
Just as i thought, printing this one requires a crystal report. Ive been googling this one for some time now and i asked someone (we just met through a friend but unfortunately we never met again) if i really need this thing in configuring the db for me to be able to print the info. Am just wondering how he do it cause he said
"No. .NET has its own printing subsystem that uses GDI+ for Windows Forms."
anyway, thank u so much rocslide. Update you if ever i find success in building this project. Thank u soooo much for your help.(=
|
|

11-30-11, 18:50
|
|
Registered User
|
|
Join Date: Nov 2003
Location: Christchurch, New Zealand
Posts: 1,617
|
|
|
|

12-01-11, 02:57
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
clicked.(=
Thank you rocslide for the link.(=
|
|

12-01-11, 21:08
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
omg, i think am having a nosebleed.. 
|
|

12-13-11, 23:33
|
|
Registered User
|
|
Join Date: Oct 2011
Posts: 45
|
|
hello rocslide, its been a while.just wanna give you an update.
I was able to make my system prints the number and it was really a treat..(=
can i add one more last question...just one more and i guess am off..(=
is it possible to add some text like
"Please proceed to counter 17. You are number ___".
thank u so much.
|
|
| Thread Tools |
Search this Thread |
|
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
|
|