Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

A question about Forms

  1. Nov 26, 2007 #1
    I searched Google and could not find a solution for this.

    I have a form with a text box and I want to make it so that when I resize the form while the application is running the text box would get resized as well and be "relative" to the size of the form.

    Any help please?
     
  2. jcsd
  3. Nov 26, 2007 #2

    jim mcnamara

    User Avatar
    Science Advisor
    Gold Member

    Obviously this is Windows (not Xterm)? Less obviously - what language are you coding in?
     
  4. Nov 26, 2007 #3
    CodeMonkey, I think what you want to do is set the Anchor property of your text field. This is a property of all Controls:

    http://msdn2.microsoft.com/en-us/library/system.windows.forms.control.anchor.aspx

    Assuming this is C#, I think you want to say
    yourtextbox.Anchor = (AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right);
     
  5. Nov 27, 2007 #4
    Coin, thanks, that worked. :-)
     
Know someone interested in this topic? Share this thread via Reddit, Google+, Twitter, or Facebook

Have something to add?



Similar Discussions: A question about Forms
  1. Question about Java (Replies: 4)

Loading...