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 8083297
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T17:25:04+00:00 2026-06-05T17:25:04+00:00

I am trying to create my own Native win32 C++ Checkbox that can have

  • 0

I am trying to create my own Native win32 C++ Checkbox that can have a transparent background. The idea is to make the window/widget look exactly like the Windows XP style checkbox except that it can have a transparent background.

My Problem: When I draw the tick for my textbox, the ‘tick’ line looks pixelated and jagged – see my picture below for how it looks. It does not look smooth like the actual checkbox tick.

The left checkbox is mine, the right is the default windows one I am trying to replicate:
enter image description here

How can I make my tick smooth and not pixelated. What is a Win32 GDI function I could use to draw the tick. Should I use a bitmap image instead of drawing the tick in GDI? Currently I use PolylineTo() to draw the tick. Maybe I should use PolylineToEx()?

Any advice would be greatly appreciated.

Code for drawing the tick(this code is in WM_PAINT):

 HGDIOBJ hPen      = CreatePen(PS_SOLID, 2, RGB(45,45,45)); //ExtCreatePen(PS_COSMETIC, dwPenStyle[i], 1, &lb, 0, NULL); 
 HGDIOBJ hPenOld   = SelectObject(hdc, hPen); 
 POINT tickPnts[3] = {{3,((height-CHECK_RECTH)/2)+6}, {5,((height-CHECK_RECTH)/2)+9}, {9,((height-CHECK_RECTH)/2)+2}};
 MoveToEx(hdc, tickPnts[0].x, tickPnts[0].y, NULL);
 PolylineTo(hdc, tickPnts, 3);
 SelectObject(hdc, hPenOld); 
 DeleteObject(hPen); 
  • 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-06-05T17:25:06+00:00Added an answer on June 5, 2026 at 5:25 pm

    Windows uses the Marlett font to render checkbox ticks, the window frame buttons and other scalable UI elements. You can render the font with anti-aliasing to get smooth edges.

    (This certainly used to be true anyway; I don’t know for sure that the new window frame buttons in Windows 7 use the font, but the font still exists.)

    GDI doesn’t do any anti-aliasing, which is why your lines look jagged.

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

Sidebar

Related Questions

I am trying to create my own Perl module in /usr/local/lib/perl I have the
I'm trying to create my own subclass of socket.socket that will be able to
I am trying to create my own styled checkbox jQuery plugin. What I want
I've been trying to create my own custom LiveValidation ( LiveValidation.com ) function that
I'm trying to create my own 'modal' window since none of these currently existing
I'm trying to create my own modal window (the built in popup manager won't
I'm trying to create my own Vector2D class, similar to that of XNA's, to
I'm trying to create my own small Windows 7 Phone app. I have downloaded
I am trying to create my own shell that is a shell replacement for
I'm trying to create my own error window for the project I am working

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.