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 .NET 3.5 WinForms project that uses several 3rd party controls and
I have a website (ASP.NET) and some winforms(.Net 2.0) for a project (written in
I have created a setup project in VS2008. My WinForms app uses .NET 2.0,
I have a WinForms application with a DataGridView control and a column of DataGridViewButtonCell
We have a couple of winforms applications that host a bunch of icons in
I have created a winforms project, and created an installer for it. When installed
I have 3 winforms in my project and on Form3 there is a checkbox.
I have a very small VS2008 Winforms project that will not start. When I
I have a winforms projects and we use the command pattern. We are trying
I have a winforms application that normally is at about 2-4% CPU. We are

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.