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

The Archive Base Latest Questions

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

I am trying to make a usercontrol which is a 3D line that sits

  • 0

I am trying to make a usercontrol which is a 3D line that sits above the “Ok” and “Cancel” button as seen in the Thunderbird windows sometimes:

http://s11.postimage.org/gh45ux9wj/thunderbird1.png

I do not want to have to set the anchor property manually each time I put the usercontrol on a form, that is why I wanted to make it so within the usercontrol that it docks automatically to the parent (Left=0, Width=Parent.Width).

However, I do not really manage to do so.

My attemps were manyfold, so I am not sure what I should post here.

My assumption was that I should use

Private Sub UserControl1_ParentChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ParentChanged

    Me.SetBounds(0, Me.Top, Me.Parent.Width, 0, BoundsSpecified.X Or BoundsSpecified.Y Or BoundsSpecified.Width)

End Sub

But that does not work at all.

  • 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-12T23:22:51+00:00Added an answer on June 12, 2026 at 11:22 pm

    You need to add an event handler to the parent’s Resize event so that you will be notified every time the parent’s size changes. For instance, something like this will work:

    Public Class ThreeDLine
        Private _lastParent As Control
    
        Private Sub Parent_Resize(ByVal sender As Object, ByVal e As EventArgs)
            resizeToParentWidth()
        End Sub
    
        Private Sub Divider_ParentChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.ParentChanged
            If _lastParent IsNot Nothing Then
                RemoveHandler _lastParent.Resize, AddressOf Parent_Resize
            End If
            _lastParent = Parent
            If Parent IsNot Nothing Then
                AddHandler Parent.Resize, AddressOf Parent_Resize
                resizeToParentWidth()
            End If
        End Sub
    
        Private Sub resizeToParentWidth()
            If Parent IsNot Nothing Then
                Me.Left = 0
                Me.Width = Parent.ClientSize.Width
            End If
        End Sub
    End Class
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to make a generic Search UserControl that can be given some values,
I am trying to make a Rectangle (or a UserControl for that matter) lap
I'm trying to make a user control that has a few DependencyProperties which are
So I'm trying to make a custom user control for a Windows Phone 7
I'm trying make an entity with doctrine that has three associations with other entities
I am fairly new to iOS development and trying make a simple app which
Trying to make this jQuery filter that uses .find case-insensitive. For example, when the
I am trying to create a UserControl that is draggable in a Canvas .
I am using WPF and I'm trying to make a class inherit from UserControl
I'm trying to make a spellcheck function in my application that will show a

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.