Simple question from beginner regarding picturebox

chrisjenkins

New member
Joined
Sep 5, 2009
Messages
2
Programming Experience
Beginner
It has been years since I studied programming, when I did, I knew the basics of VB6. I am using VB 2008 Express Edition now. What is the best way to display information to the user. Let's just say I have a simple program where the user enters a peson's name and cost of different parts/supplies and then displays a bill back to them. Everything is on the same form with a picturebox(or whatever is used now) at the bottom of the form to display the results.
What I used to do for this is
Picturebox.print Customername;
Picturebox.print supplies;
picturebox.print and so on;

But for vb.net it says "Print is not a member of picturebox", how do I do this now?


Output look like this
Customer Name John Doe
Supplies $50.00
Tax $4 .00
Total $54.00

Thanks
 
The closest equivalent of that would be to use GDI+, but it would be done somewhat differently. You would store the text to be drawn into one or more member variables and then force the PictureBox to repaint by calling its Refresh method. You'd then handle the Paint event of the control and call e.Graphics.DrawString one or more times to draw the text.

You might want to do a bit of reading before proceeding. I'd suggest looking at the Control.Paint event, the Graphics class and GDI+ in general.
 
I suppose one way is to use a label
VB.NET:
        Label1.Text = "Customer Name John Doe" & vbCrLf & "Supplies $50.00" & vbCrLf & "Tax $4 .00" & vbCrLf & "Total $54.00"
 
I suppose one way is to use a label
VB.NET:
        Label1.Text = "Customer Name John Doe" & vbCrLf & "Supplies $50.00" & vbCrLf & "Tax $4 .00" & vbCrLf & "Total $54.00"

Thanks this example worked perfectly, but I thought what I am trying to do should be pretty common in programs. So my question is what do most people use, how do most programmers show their output for a report generated.
Thanks
 
I think one or multiple labels depending on your forms layout would be the common way of displaying this kind of output.
 
Back
Top