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
  1. Home
  2. General Programming
  3. C#
  4. statusbar UI

statusbar UI

Scheduled Pinned Locked Moved C#
graphicsdesignquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • O Offline
    O Offline
    osto
    wrote on last edited by
    #1

    just wondering what methods do i need to override to be able to change bankground color of the status bar? set for exemple a gradient fill backgroung like with iexplorer/explorer. so far i got just been able to have the devider but no bg :( private void statusbarDrawItem(object sender, System.Windows.Forms.StatusBarDrawItemEventArgs sbdevent) { StatusBarPanel ssb = sbdevent.Panel; Rectangle rect = sbdevent.Bounds; sbdevent.Graphics.DrawLine(new Pen(Color.White), rect.Right-1,rect.Top,rect.Right-1,rect.Bottom-2); sbdevent.Graphics.DrawLine(SystemPens.ControlDark, rect.Right-2,rect.Top,rect.Right-2,rect.Bottom-2);}

    H 1 Reply Last reply
    0
    • O osto

      just wondering what methods do i need to override to be able to change bankground color of the status bar? set for exemple a gradient fill backgroung like with iexplorer/explorer. so far i got just been able to have the devider but no bg :( private void statusbarDrawItem(object sender, System.Windows.Forms.StatusBarDrawItemEventArgs sbdevent) { StatusBarPanel ssb = sbdevent.Panel; Rectangle rect = sbdevent.Bounds; sbdevent.Graphics.DrawLine(new Pen(Color.White), rect.Right-1,rect.Top,rect.Right-1,rect.Bottom-2); sbdevent.Graphics.DrawLine(SystemPens.ControlDark, rect.Right-2,rect.Top,rect.Right-2,rect.Bottom-2);}

      H Offline
      H Offline
      Heath Stewart
      wrote on last edited by
      #2

      You want to use Graphics.FillRectangle with a LinearGradientBrush:

      private void statusBarDrawItem(object sender,
      StatusBarDrawItemEventArgs e)
      {
      // Should consider caching this brush for better performance.
      LinearGradientBrush gradient = new LinearGradientBrush(
      e.Bounds, Color.Blue, e.BackColor, LinearGradientMode.Horizontal);
      e.Graphics.FillRectangle(gradient, e.Bounds);
      // Draw lines and strings after the background, of course.
      }

      Microsoft MVP, Visual C# My Articles

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

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