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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T03:12:12+00:00 2026-05-11T03:12:12+00:00

I have a Winforms project with a bunch of User controls. I’d like the

  • 0

I have a Winforms project with a bunch of User controls. I’d like the user control to move itself to be at the 1,1 position relative to its container (whether it’s a form or a Panel control). And resize itself to be able to fit half the container.

What event can I respond to in the UserControl to be able to do this without any code having to be written in the container (e.g. the form or panel).

  • 1 1 Answer
  • 3 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-11T03:12:13+00:00Added an answer on May 11, 2026 at 3:12 am

    You could use the basic Load event.

    The code could be like this:

    private void UserControl1_Load(object sender, EventArgs e) {     Control parent = this.Parent;     if (parent != null)     {         this.Location = new Point(1, 1);         this.Width = (parent.Width / 2);         this.Height = (parent.Height / 2);     } } 
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a VS2010 Winforms project with several forms and user controls, all integrated
I am working in a C# winforms project and I have a user control
I have a winforms project that I want to develop a custom control for.
I have one WinForms control project that produces a dll. There is a second
I have a WPF control (the ICSharpCode.AvalonEdit.TextEditor ) in a Winforms project inside an
I have a .NET 3.5 WinForms project that uses several 3rd party controls and
In my WinForms project, I have 2 Inputboxes pop up asking the user for
I'm using an ErrorProvider control in winforms project. Its working for the most part
I have this WinForms project (based on this one , but modified for SharePoint
I have a .Net winforms project with a short time table (about a week

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.