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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T15:05:22+00:00 2026-06-12T15:05:22+00:00

Trying to create a simple custom control in C# Winforms that inherits from Panel,

  • 0

Trying to create a simple custom control in C# Winforms that inherits from Panel, but as soon as I change it to inherit from “Panel” instead of “UserControl” I get this error:

enter image description here

Here’s the code for the entire class:

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace SETPaint
{
    public partial class Canvas : Panel
    {
        public Canvas()
        {
        InitializeComponent();
        }

        private void Canvas_Load(object sender, EventArgs e)
        {

        }
    }
}
  • 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-12T15:05:24+00:00Added an answer on June 12, 2026 at 3:05 pm

    Delete the line ‘this.AutoScaleDimensions = …’ in your Designer.cs file (line 35 according to the exception). There’s probably another similar to ‘this.AutoScaleMode = .Font’ too.

    This problem arises because you’ve used the Designer when the Control derived from UserControl, and it set some default properties in the InitializeComponent() method. Those properties are part of the UserControl base type, but not the Panel base type.

    Since the IDE Designer can’t load the Designer.cs file to fix this problem, you need to do it manually.

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

Sidebar

Related Questions

I have a custom control Workspace that inherits from Control and within it is
I'm trying to create a custom control (deriving from Control ) with its own
I have created a custom server control that inherits from CompositeControl. In the CreateChildControls
I am trying to create a simple custom control where in there is a
I'm trying to create a simple custom validator for my project, and I can't
I'm trying to create an ultra simple paypal custom integration with rails. I'm following
I'm trying to create a simple, custom, gallery. I have two lists, one with
I'm trying to create a custom component to extend PrimeFaces. I have a simple
I'm trying to create simple script that subscribes a user to a company calendar.
Im trying to create a simple pan and zoom app using silverlight 4, but

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.