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. Visual Basic
  4. SplitButton doesn't do background color [solved]

SplitButton doesn't do background color [solved]

Scheduled Pinned Locked Moved Visual Basic
question
2 Posts 1 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.
  • L Offline
    L Offline
    llandyw
    wrote on last edited by
    #1

    I have a splitbutton toolbar control that doesn't seem to work right. The BackColor property can be set and read, but doesn't show up on the control itself. I have an image with transparency, and no matter which way I change the backcolor (programmatically or in the properties), it uses the regular control color. I even checked the designer code, and the color is there. Anyway, I'm trying to implement the last chosen color for font and hiliting (the way Word/Wordpad does for their controls. Thought I'd try the background color first. Does anyone know of any code to alter a portion of the image itself? I know there's the wordpad sample, but it's a variety of C. Maybe I can convert it (if I can find it)

    modified on Saturday, March 13, 2010 5:09 PM

    L 1 Reply Last reply
    0
    • L llandyw

      I have a splitbutton toolbar control that doesn't seem to work right. The BackColor property can be set and read, but doesn't show up on the control itself. I have an image with transparency, and no matter which way I change the backcolor (programmatically or in the properties), it uses the regular control color. I even checked the designer code, and the color is there. Anyway, I'm trying to implement the last chosen color for font and hiliting (the way Word/Wordpad does for their controls. Thought I'd try the background color first. Does anyone know of any code to alter a portion of the image itself? I know there's the wordpad sample, but it's a variety of C. Maybe I can convert it (if I can find it)

      modified on Saturday, March 13, 2010 5:09 PM

      L Offline
      L Offline
      llandyw
      wrote on last edited by
      #2

      Figured out how to alter an existing image. Pretty simple really. This colors the last 4 lines of the image itself. This of course only works for a 16 x 16 image, but can easily be changed for different placement and image size. Since I have 2 controls in 3 different places, I just do:

      instance.Image = ColorImage(instance.Image, newColor)
      
      
      Private Function ColorImage(ByRef theImage As System.Drawing.Bitmap, \_
                                  ByRef theColor As System.Drawing.Color) \_
                                  As System.Drawing.Bitmap
          Dim x, y As Integer
      
          For y = 12 To 15
              For x = 0 To 15
                  theImage.SetPixel(x, y, theColor)
              Next
          Next
          ColorImage = theImage
      End Function
      
      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