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

  • Home
  • SEARCH
  • 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 6780639
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T16:31:46+00:00 2026-05-26T16:31:46+00:00

I have a owner drawn control where I need to draw the expand box

  • 0

I have a owner drawn control where I need to draw the expand box (“plus/minus”) of a treeview. With visual styles turned on it is easy, just create a renderer for the appropriate VisualStyleElement:

VisualStyleElement element = VisualStyleElement.TreeView.Glyph.Opened
VisualStyleRenderer renderer = new VisualStyleRenderer( element );
Size size = renderer.GetPartSize( graphics, ThemeSizeType.True );
...
renderer.DrawBackground( graphics, someRect );

Is it possible to achieve a similar effect when visual styles are off? I know there is a ControlPaint class which can draw entire controls, but how do I draw (and get the size of) just a part of the TreeView control?

  • 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-26T16:31:47+00:00Added an answer on May 26, 2026 at 4:31 pm

    Without VisualStyles, I think the plus minus controls are just DrawRectangle and DrawLine method calls.

    The Rectangle part looks like it uses the SystemColors.Control color, and the Plus/Minus part looks like SystemColors.ControlText (or black).

    enter image description here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an owner-drawn list control in my Windows program. I use CListCtrl::GetBkColor to
I have a variable-height owner draw ListBox control. When I call AddString, a MeasureItem
I have an Owner Drawn List Box in an external application ( America Online
I have an owner drawn header of a ListView control. If the header is
I have an owner-drawn listbox control. The problem is that sometimes the DrawItemEventArgs argument
I have an owner-drawn UserControl where I've implemented double-buffering. In order to get double-buffering
Is it possible to have variable size (owner draw) items in the Win32 ListView,
I have this Win32 user-drawn tab control that is created as: CONTROL Tab1,IDC_TAB_CONT,SysTabControl32,TCS_BOTTOM |
I am trying to owner draw a List View control in report-mode with 4
Please excuse my ignorance, but I have come across this term owner drawn listbox.

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.