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. Custom ComboBox Problem

Custom ComboBox Problem

Scheduled Pinned Locked Moved Visual Basic
csharpgraphicshelp
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.
  • J Offline
    J Offline
    Jason Stamp
    wrote on last edited by
    #1

    I am creating a custom control in VB.NET that inherits from System.Windows.Froms.ComboBox. I am doing this so I can draw over the combo box to change it's appearance. To do the drawing I am overriding WndProc and capture the WM_PAINT message. I can draw the background with no problems, but the problem is with the selected text, as the base class draws an edit box on top for this. When I want to set the enable property to false, the text and background is always grey. I need to be able to change the colour of this when disabled. My other approach to this is to set a back color and not use the enabled property, but can't seem to override the OnClick event and cancel the event if another property is set to disable the control. Any advice on this matter would be greatly appreciated. Thanks J

    J 1 Reply Last reply
    0
    • J Jason Stamp

      I am creating a custom control in VB.NET that inherits from System.Windows.Froms.ComboBox. I am doing this so I can draw over the combo box to change it's appearance. To do the drawing I am overriding WndProc and capture the WM_PAINT message. I can draw the background with no problems, but the problem is with the selected text, as the base class draws an edit box on top for this. When I want to set the enable property to false, the text and background is always grey. I need to be able to change the colour of this when disabled. My other approach to this is to set a back color and not use the enabled property, but can't seem to override the OnClick event and cancel the event if another property is set to disable the control. Any advice on this matter would be greatly appreciated. Thanks J

      J Offline
      J Offline
      j45mw
      wrote on last edited by
      #2

      I would suggest you go to this project and use it. It is a great combobox and is easy to work with. I also think it will let you do all of the things you are asking about. http://www.codeproject.com/vb/net/MultiColumnFlatCombo.asp It also has a 3D setting so don't let the title fool you.

      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