Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
F

firda cze

@firda cze
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • What do you do with a person like this?
    F firda cze

    Ask yourself a question: why is he "unable to test code before pushing it"? Is he so stupid or is he so overworked (all these years without a help) and now has even less time to do what he is ordered to do (by manager) because he has to cope with endless questions and complains by you and others on top of his already busy schedule? And how about you - did you even try to see his situation or are you all under such stress that you do not even have the time to stop and think clearly? Did anybody actually asked him what he needs? ...or you just came in like a flood with "it is our code now and this is how it is gonna be .... you stupid little...." Start by writing tests and think how to divide the task in such a way that you do not need each others perfect and up-to-date code. Do you really need him to first implement/fix something for you to do your job or you could actually create some independent test-layer or fix it yourself but are lazy and complaining, all blaming the one and only that managed to keep it all running that long with bus factor of 1? Are you really helping?

    The Lounge database testing beta-testing help question

  • I hate Microsoft (well today anyway)
    F firda cze

    I hate that too. I switch off my computer every day and that is the perfect time to make it update. Well, it need some more time in the morning, stupid, but it does not hurt that much as if it forces a restart late at night when I am still working at home - I have no standard work-time in this case, stupids from MS! Just wait 24 hours before forcing any update!!! ...and if I choose to update when switching off, do complete it by restarting and trully switching off when done! Ahh, sorry for being angry... worst things are often done with good intentions :rolleyes:

    The Lounge database linux question announcement

  • Text over Progressbar - Question
    F firda cze

    public class ProgressLabel: ProgressBar {
    private static StringFormat sfCenter = new StringFormat() {
    Alignment = StringAlignment.Center, LineAlignment = StringAlignment.Center };
    private Color textColor = DefaultTextColor;
    private string progressString;
    public ProgressLabel() { SetStyle(ControlStyles.AllPaintingInWmPaint, true); }
    protected override void OnCreateControl() {
    progressString = null;
    base.OnCreateControl();
    }
    protected override void WndProc(ref Message m) {
    switch(m.Msg) {
    case 15: if(HideBar) base.WndProc(ref m);
    else {
    ProgressBarStyle style = Style;
    if(progressString == null) {
    progressString = Text;
    if(!HideBar && style != ProgressBarStyle.Marquee) {
    int range = Maximum-Minimum;
    int value = Value;
    if(range > 42949672) { value = (int)((uint)value>>7); range = (int)((uint)range>>7); }
    if(range > 0) progressString = string.Format(progressString.Length == 0 ? "{0}%" : "{1}: {0}%",
    value*100/range, progressString);
    }
    }
    if(progressString.Length == 0) base.WndProc(ref m);
    else using(Graphics g = CreateGraphics()) {
    base.WndProc(ref m);
    OnPaint(new PaintEventArgs(g, ClientRectangle));
    }
    }
    break;
    case 0x402: goto case 0x406;
    case 0x406: progressString = null;
    base.WndProc(ref m);
    break;
    default:
    base.WndProc(ref m);
    break;
    }
    }
    protected override void OnPaint(PaintEventArgs e) {
    Rectangle cr = ClientRectangle;
    RectangleF crF = new RectangleF(cr.Left, cr.Top, cr.Width, cr.Height);
    using(Brush br = new SolidBrush(TextColor))
    e.Graphics.DrawString(progressString, Font, br, crF, sfCenter);
    base.OnPaint(e);
    }
    public bool HideBar {
    get { return GetStyle(ControlStyles.UserPaint); }
    set { if(HideBar != value) { SetStyle(ControlStyles.UserPaint, value); Refresh(); } }
    }
    public static Color DefaultTextColor {
    get { return SystemColors.ControlText; }
    }
    public Color TextColor {
    get { return textColor; }
    set { textColor = value; }
    }
    public override string Text {
    get { return base.Text; }
    set { if(value != Text) { base.Text = value; progressString = null; } }
    }
    public override Font Font {
    get { return base.Font; }
    set { base.Font = value; }
    }
    }

    C# graphics question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups