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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T12:44:57+00:00 2026-05-11T12:44:57+00:00

If I override OnPaint and draw a square on the control, how do I

  • 0

If I override OnPaint and draw a square on the control, how do I get that e.graphics.draw… to show up when I’m previewing it in the designer?

  • 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. 2026-05-11T12:44:57+00:00Added an answer on May 11, 2026 at 12:44 pm

    http://msdn.microsoft.com/en-us/magazine/cc164048.aspx

    http://msdn.microsoft.com/en-us/magazine/cc164145.aspx

    While you could manually register with Control.OnPaint to add your design time UI, you’ll find that overriding OnPaintAdornments is a better option because it is only called after the control’s design-time/run-time UI is painted, letting you put the icing on the cake (see Figure 20). Simply adding DesignerAttribute to the ClockControl class completes the association: Copy Code

    [ Designer(typeof(ClockControlDesigner)) ] class ClockControl : Control { … }

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

Sidebar

Related Questions

I am using Graphics.DrawString to draw my usercontrol's text like this: protected override void
I developed some components with their own OnPaint -override where I draw them. I
I create a new Control and overided the OnPaint event: protected override void OnPaint(PaintEventArgs
I have the following code: int a = 0; protected override void OnPaint(System.Windows.Forms.PaintEventArgs e)
In C# I have custom form of None border style which override onPaint event
I have code which will draw a graph that scales if the user attempts
I am wondering when should we call the base.OnPaint when we override OnPaint in
I'm trying to override the OnPaint method of a label in my own custom
I have a WinForm where I override the OnPaint , this form is a
I have a control. It's a text box. I want to draw an image

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.