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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T13:46:45+00:00 2026-05-15T13:46:45+00:00

It is in Winforms. I have a UserControl that is anchored TOP, BOTTOM and

  • 0

It is in Winforms.

I have a UserControl that is anchored TOP, BOTTOM and LEFT. I would like to allow the user to drag its right border somehow and resize it horizontally.

The control is placed right into the form, no panel or groupbox to place a “Splitter”.

Any idea how to make a control resizable at runtime by the user?

  • 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-05-15T13:46:46+00:00Added an answer on May 15, 2026 at 1:46 pm
    Private Declare Function GetWindowLongA Lib "User32" (ByVal hWnd As Integer, ByVal nIndex As Integer) As Long
    Private Declare Function SetWindowLongA Lib "User32" (ByVal hWnd As Integer, ByVal nIndex As Integer, ByVal dwNewLong As Long) As Long
    Private Declare Sub SetWindowPos Lib "User32" (ByVal hWnd As Integer, ByVal hWndInsertAfter As Integer, ByVal X As Integer, ByVal Y As Integer, ByVal CX As Integer, ByVal CY As Integer, ByVal wFlags As Integer)
    Const SWP_NOSIZE = &H1
    Const SWP_NOZORDER = &H4
    Const SWP_NOMOVE = &H2
    Const SWP_DRAWFRAME = &H20
    Const GWL_STYLE = (-16)
    Const WS_THICKFRAME = &H40000
    
    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        ResizeControl(TextBox1, Me)
    End Sub
    
    Sub ResizeControl(ByVal ControlName As Control, ByVal FormName As Form)
        Dim NewStyle As Long
        NewStyle = GetWindowLongA(ControlName.Handle, GWL_STYLE)
        NewStyle = NewStyle Or WS_THICKFRAME
        NewStyle = SetWindowLongA(ControlName.Handle, GWL_STYLE, NewStyle)
        SetWindowPos(ControlName.Handle, FormName.Handle, 0, 0, 0, 0, SWP_NOZORDER Or SWP_NOSIZE Or SWP_NOMOVE Or SWP_DRAWFRAME)
    End Sub
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a winforms app that uses a UserControl. The user control's job is
I have a WPF control that I would like to overlay onto a WinForms
I have a WinForms user control Host with a custom UI Editor. Through that
I have UserControl that holds Infragistics Graph control. On the TreeView sub node's right
I have created a WinForms user control that is a set of five cascading
I have a Winforms project with a bunch of User controls. I'd like the
I have a userControl (.NET 1.1 Winforms) that has a clickable picturebox as a
Using WinForms I am coding a Component user control where I would like it
I have several winforms listbox controls I am hosting in a user control. The
I have a have Winforms client that uses Web services on a IIS7 (W2008)

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.