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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:46:14+00:00 2026-06-08T04:46:14+00:00

Got two textbox’s one represents the form’s width, and the another height. When the

  • 0

Got two textbox’s one represents the form’s width, and the another height.

When the form loads it displays the size of the form’s width, and height in each textbox.

When you resize the form it’ll automatically update the text in the texbox’s and tell you what the form’s current size is.

How can I do this?


I used the code below so you can set the size you want and then it applys it to the form’s size, but still haven’t figured out how to automatically detect the form’s width, and height when it’s resized.

Private sizew As Integer
Private sizey As Integer

sizew = TextBox1.Text
sizey = TextBox2.Text
Me.Size = New System.Drawing.Size(sizew, sizey)

Figured out what I was doing wrong. For those that wonder how to do this, here’s the code below.

Private sizew As Integer
Private sizey As Integer

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
    TextBox1.Text = Me.Size.Width()
    TextBox2.Text = Me.Size.Height()
End Sub

Private Sub Form1_SizeChanged(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.SizeChanged
    TextBox1.Text = Me.Size.Width()
    TextBox2.Text = Me.Size.Height()
End Sub
  • 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-08T04:46:15+00:00Added an answer on June 8, 2026 at 4:46 am

    Handle the SizeChanged event and read Me.Size.

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

Sidebar

Related Questions

I've got a textbox in my XAML file: <TextBox VerticalScrollBarVisibility=Visible AcceptsReturn=True Width=400 Height=100 Margin=0
I've got a simple WPF dialog with these two controls: <TextBox Text={Binding MyText}/> <Button
I got two data storages in my Windows Azure account. One is for the
I got two gridviews in the same page, which basically displays the same type
Imagine that in one data template, I have a textBox, and another data template,
I've got two forms. In the first, I have a textbox and a button,
I've got Windows Forms project. There's a textBox on the form, called txt. The
I've got to call two js functions, setfocus on textbox and stop a postback
I've got view: @using (Html.BeginForm(ProcessRoute, Calculator)) { @Html.TextBox(CityArrival, null, new { @style = width:
I've got a ASP.NET 3.5 sp1 site, and on one page I have two

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.