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

The Archive Base Latest Questions

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

I have a base User Control. I place Ok and Cancel buttons on the

  • 0

I have a base User Control. I place Ok and Cancel buttons on the bottom right of the control and anchor them Bottom and Right.

I then create another user control that inherits from the base user control. I resize the inherited control (e.g. increase height or width). Throw the inherited control onto the form. Run. The inherited control does not honor the anchor properties of the Ok and Cancel buttons.

Here are the exact steps to repro.

1 – Create a new winforms project

2 – Create a base control (BaseControl1) with a Ok and Cancel buttons located at bottom/right. Anchor them there at Bottom,Right. Compile the app.

3 – Create a new User Control (UserControl1) that inherits from the base control (BaseControl1), created in step 1.

4 – Increase (in the designer) UserControl1’s height or width.

5 – Throw UserControl1 onto Form1. Run. You’ll see that Ok and Cancel buttons are not where they are supposed to be.

Am I doing something wrong, or does VS2008 simply not honor the anchor properties of the controls on the base user 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. 2026-05-11T05:13:27+00:00Added an answer on May 11, 2026 at 5:13 am

    Change the Modifiers property on your buttons to Protected. Then, after you complete step 4, you’ll notice the designer code for UserControl1 now contains a line of code to set the buttons’ locations. That wasn’t happening when your buttons were scoped as Friend.

    I’ve always wondered why controls dropped from the toolbox weren’t scoped to Private by default.

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

Sidebar

Related Questions

I have user control that inherits a base control class and these user controls
I have a custom base user control in silverlight. <UserControl x:Class=Problemo.MyBaseControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml xmlns:d=http://schemas.microsoft.com/expression/blend/2008
I have a series of composite user controls that inherit from a base class
I have a base class for some kind of user controls, and in that
I have a user control...and the base page(s) which uses this user control has
I got a web user control where I have controls that needs to be
In my C# Windows Forms application, I have a user control that contains other
I have a user control UserApplianceControl that I need to dynamically add to a
I have a base user control (inherited from System.Web.UI.UserControl ) public delegate void MyEventHandler(object
I have created successfully a wpf user control inheritance like this: <base:BaseUserControl x:Class=wpfcontrolinheritance.InheritedUserControl xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation

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.