How do I make a custom progress bar?

Do you need something made? then ask in here.
Forum rules
Please LOCK your topics once you have found the solution to your question so we know you no longer require help with your query.
27 posts Page 2 of 3
Contributors
User avatar
lawrence12
Dedicated Member
Dedicated Member
Posts: 73
Joined: Tue Mar 02, 2010 3:21 am

:o still no posts O_O
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

What's there to post about now?
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Hello lawrence12,

I thought mandai gave a very good answer to your question: viewtopic.php?f=32&t=2219#p13892

Unless you need help doing something else?
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
lawrence12
Dedicated Member
Dedicated Member
Posts: 73
Joined: Tue Mar 02, 2010 3:21 am

Okay Codie thanks wahooo;
User avatar
lawrence12
Dedicated Member
Dedicated Member
Posts: 73
Joined: Tue Mar 02, 2010 3:21 am

but where do I put that code in?
The Post you posted included a code in it but no instructions, meaning no details or stuff, so I didn't learn anything :|
User avatar
lawrence12
Dedicated Member
Dedicated Member
Posts: 73
Joined: Tue Mar 02, 2010 3:21 am

:( And I got a NullReferenceException was unhandled error.
How cool was that?, the post didn't help at all.
User avatar
CodenStuff
Site Admin
Site Admin
Posts: 4392
Joined: Tue Aug 04, 2009 1:47 am

Hello,

You need to add a Button control and PictureBox control to your form and then use the code like:

Add under "Public Class Form":
Code: Select all
Dim gfx As Graphics
    Dim percent As Integer = 0
Inside the "Form_Load" event:
Code: Select all
 PictureBox1.BorderStyle = BorderStyle.FixedSingle
        PictureBox1.Image = New Bitmap(PictureBox1.Width, PictureBox1.Height)
        gfx = Graphics.FromImage(PictureBox1.Image)
Inside the "Button_Click" event:
Code: Select all
 percent += 10
        gfx.FillRectangle(Brushes.Black, New RectangleF(0, 0, PictureBox1.Width / 100 * percent, PictureBox1.Height))
        PictureBox1.Refresh()
Ive added it into the project below to demonstrate mandai code.

Download:
CustomProBar.zip
You do not have the required permissions to view the files attached to this post.
Welcome to CodenStuff.com Learn Code, Love Code. Thank you for being a member of the community.
User avatar
mandai
Coding God
Coding God
Posts: 2585
Joined: Mon Apr 26, 2010 6:51 pm

lawrence12 wrote:
but where do I put that code in?
The Post you posted included a code in it but no instructions, meaning no details or stuff, so I didn't learn anything :|
You put the code in your Form1.vb file.

You diddn't ask for detail in your request (in fact you diddn't even explain how it should be custom). If you know what the types and functions are for then it should be easy to understand.
User avatar
lawrence12
Dedicated Member
Dedicated Member
Posts: 73
Joined: Tue Mar 02, 2010 3:21 am

mandai wrote:
lawrence12 wrote:
but where do I put that code in?
The Post you posted included a code in it but no instructions, meaning no details or stuff, so I didn't learn anything :|
You put the code in your Form1.vb file.

You diddn't ask for detail in your request (in fact you diddn't even explain how it should be custom). If you know what the types and functions are for then it should be easy to understand.
Oh Im sorry but Im not that advanced yet.
User avatar
lawrence12
Dedicated Member
Dedicated Member
Posts: 73
Joined: Tue Mar 02, 2010 3:21 am

CodenStuff wrote:
Hello,

You need to add a Button control and PictureBox control to your form and then use the code like:

Add under "Public Class Form":
Code: Select all
Dim gfx As Graphics
    Dim percent As Integer = 0
Inside the "Form_Load" event:
Code: Select all
 PictureBox1.BorderStyle = BorderStyle.FixedSingle
        PictureBox1.Image = New Bitmap(PictureBox1.Width, PictureBox1.Height)
        gfx = Graphics.FromImage(PictureBox1.Image)
Inside the "Button_Click" event:
Code: Select all
 percent += 10
        gfx.FillRectangle(Brushes.Black, New RectangleF(0, 0, PictureBox1.Width / 100 * percent, PictureBox1.Height))
        PictureBox1.Refresh()
Ive added it into the project below to demonstrate mandai code.

Download:
CustomProBar.zip
Well I was looking for a stylish one :|
27 posts Page 2 of 3
Return to “Tutorial Requests”