C#: ProgressBar with percentage menu

Shout-Out

User Tag List

Results 1 to 2 of 2
  1. #1
    kisjaksi's Avatar Member
    Reputation
    1
    Join Date
    Aug 2008
    Posts
    17
    Thanks G/R
    0/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    C#: ProgressBar with percentage

    I made a progressbar-control, which is supposed to write the percentage in the middle of the progressbar, but it doesn't work. Why?!
    Code:
        class PProgressBar : ProgressBar
        {
            public PProgressBar()
                : base()
            {
            }
    
            protected override void OnPaint(PaintEventArgs e)
            {
                base.OnPaint(e);
                e.Graphics.DrawString((100 * this.Value / this.Maximum).ToString(), new Font("Arial", 8.25f), Brushes.Black, new PointF(this.Size.Width / 2 - 10, this.Size.Height / 2 - 8));
            }
        }

    C#: ProgressBar with percentage
  2. #2
    LaoArchAngel's Avatar Active Member
    Reputation
    47
    Join Date
    Apr 2009
    Posts
    63
    Thanks G/R
    1/0
    Trade Feedback
    0 (0%)
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Turns out that M$ decided to seal the ProgressBar class, but not in such a way that it would throw an exception when you try to inherit from it (or when you check IsSealed, for that matter). Regardless, M$, in their own words, say the progressbar class is sealed, and so it'll never even call the OnPaint event when overriden.

    There are some places that say you can still override if you use SetStyle in the constructor, but all I saw then was the text w/ no bar.

    There's a tutorial by M$ titled something like "How to build smooth progress bars" which let's you create your own progress bar control on which you can override the OnPait event w/ your changes.

Similar Threads

  1. Help with Party Health Percentage
    By Tiger23078001 in forum PE Support forum
    Replies: 2
    Last Post: 01-25-2016, 06:28 PM
  2. ZF Witch Doctor Hunting for Hunter (with video)
    By Matt in forum World of Warcraft Exploits
    Replies: 9
    Last Post: 06-21-2006, 07:39 PM
  3. Farm AQ with a Hunter
    By Matt in forum World of Warcraft Exploits
    Replies: 3
    Last Post: 04-04-2006, 01:31 PM
  4. World of Warcraft Bot (GetALifeBot) 0.57 working with 1.9.4
    By Matt in forum World of Warcraft Bots and Programs
    Replies: 7
    Last Post: 03-07-2006, 09:43 PM
  5. Getting into BG with that pesky deserters buff!
    By janzi9 in forum World of Warcraft Exploits
    Replies: 0
    Last Post: 03-06-2006, 11:35 PM
All times are GMT -5. The time now is 05:06 PM. Powered by vBulletin® Version 4.2.3
Copyright © 2025 vBulletin Solutions, Inc. All rights reserved. User Alert System provided by Advanced User Tagging (Pro) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Google Authenticator verification provided by Two-Factor Authentication (Free) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
Digital Point modules: Sphinx-based search