Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 497155
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T05:45:16+00:00 2026-05-13T05:45:16+00:00

I have a ComboBox that I have set DrawMode = DrawMode.OwnerDrawFixed . Then I

  • 0

I have a ComboBox that I have set DrawMode = DrawMode.OwnerDrawFixed. Then I handle the OnDrawItem event and everything works perfectly. However, it looks very different from a standard ComboBox because mine doesn’t seem to be rendered using VisualStyles. Do I need to do something to specifically enable VisualStyle rendering for my owner drawn control? I have tried SetWindowTheme on my control, but I’m not sure what theme class to send. Any help would be much appreciated. Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T05:45:16+00:00Added an answer on May 13, 2026 at 5:45 am

    The down side of owner-draw is that when you turn it on, the owner (you) has to draw everything. You are almost completely on your own.

    If you want visual styles, then you have to call the VisualStyles APIs directly to do what you want. If you want to show selected, focussed, enabled/disabled states, then you have to write code to deal with them all.

    This isn’t a direct answer for your combo-box issues, but as an example of how to use VisualStyles, here is how I’ve used VisualStyles in an owner-drawn TreeView to draw the Plus/Minus icon:

    // Draw Expand (plus/minus) icon if required
    if (ShowPlusMinus && e.Node.Nodes.Count > 0)
    {
        // Use the VisualStyles renderer to use the proper OS-defined glyphs
        Rectangle expandRect = new Rectangle(iconLeft-1, midY - 7, 16, 16);
    
        VisualStyleElement element = (e.Node.IsExpanded) ? VisualStyleElement.TreeView.Glyph.Opened
                                                         : VisualStyleElement.TreeView.Glyph.Closed;
    
        VisualStyleRenderer renderer = new VisualStyleRenderer(element);
                renderer.DrawBackground(e.Graphics, expandRect);
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

If I have a ComboBox that has a SelectionChanged event, it fires when I'm
I have a comboBox that has a datatrigger that set its SelectedIndex based on
Using C#, say you have a ComboBox that has a DropDownStyle set to DropDown
I have a ComboBox that I set up like this: this.cmbCustomerJob.DisplayMember = display; this.cmbCustomerJob.AutoCompleteMode
I have a ComboBox that it looks like this: <ComboBox ItemsSource={Binding JobList} SelectedValue={Binding Job,UpdateSourceTrigger=PropertyChanged,Mode=TwoWay}
I have a ComboBox that is bound to an ObservableCollection of custom UserControls. Each
I have a ComboBox that has an associated ErrorProvider in the user control it
I have a comboBox that displays different Municipalities (these Municipalities belongs to a particular
I have created a custom combobox that has a LABEL property so when we
We have a WinForms control that is an extended version of ComboBox that supports

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.