Question Progressbar help

masterg174

New member
Joined
Mar 7, 2010
Messages
1
Programming Experience
Beginner
Hi, for my school project I have to make a ordering form similar to that of McDonalds using visual basic. I have just added a progress bar and programmed it to start when I click the checkout button after choosing everything you would like to order and am just wondering how i could possible add a description box of what the current operation is. by current operation I mean display any text I want at different percentages within a textbox or a listbox.

for instance for a cheeseburger:
20%:
Cutting Bun
40%:
Rolling Meat
60%:
Grilling Meat
80%:
Adding to bun
100%:
Adding Sauce

Or for a cheeseburger and drink:
1% Preparing and Cooking Meat Patty
40% Preparing Burger Setup
60% Adding Cheese to Patty 75% Adding Cheese Patty to Burger setup
80% Wrapping burger
85% Filling cup with drink
90% Placing burger and napkins in bag and putting lid on cup
100% Order Complete

I am wondering if it would be possible to do this for each item in the ordering box but not sure how i would go about coding that.


Here is the code I have for the progress bar:


Timer1 Code:
progbar_Orderprogress.Increment(1)
If progbar_Orderprogress.Value = 100 Then
End If
End Sub

BtnCheckout:
Timer1.Start()

Thanks in Advance!


Here is my visual basic project as well if you want a clearer understanding of what I mean

Attached is a picture example of what I mean:

ExampleofCurrentOperation.jpg
 
Last edited:
You may be able to use something like this :

VB.NET:
        Dim myGraphic As Graphics = Me.ProgressBar1.CreateGraphics
        Dim myString As String = "Your text"
        Dim myStringFormat As New StringFormat
        myStringFormat.LineAlignment = StringAlignment.Center
        myStringFormat.Alignment = StringAlignment.Center
        myGraphic.DrawString(myString,
                             New Font("Veranda", 8, FontStyle.Bold),
                             New SolidBrush(Color.Black),
                             CInt(Me.ProgressBar1.Width / 2), 
                             CInt(Me.ProgressBar1.Height / 2), myStringFormat)
        myGraphic.Dispose()

Of course you'd need to put this in a sub and change the text each time progress reached the appropriate spot.
 
Learnings code im not sure about as im fairly new, it just looks a bit too advanced i would use somthing a little simpler like this

VB.NET:
'progress bar 10 %
if progressbar1.value = 10 then
textbox1.text = preparing meat patty
Else
'Progress Bar 20 %
progressbar.1.value = 20
textbox1.text = cutting bun 
Else 
'Progress bar 30 % ...

This should work but you may have to tweak it a little...
 
Back
Top