|
-
Jul 4th, 2006, 04:15 PM
#1
Thread Starter
Hyperactive Member
[2005] Textbox resize
On my form i have a multiline textbox named "txteditor", here is my problem when i hit then maximize button the textbox dosent change size? here is the code im using.
VB Code:
txteditor.width = me.width
txtedirot.height = me.height
Im using vb.net 2005 express
-
Jul 4th, 2006, 04:35 PM
#2
Re: [2005] Textbox resize
You would normally set the Anchor property of the TextBox in the designer. That way you can specify any edge or combination of edges from which the control will maintain a constant distance. As the form grows or shrinks, so too the control will grow or shrink to maintain those constant distances. You also have the Dock property if you want the control hard up against an edge or to fill the parent control. If you want more complex layout control than that then you may find you need to use a TableLayoutPanel or FlowLayoutPanel. The VB Express video series (see my signature for a link) has an episode for each.
-
Jul 5th, 2006, 09:33 AM
#3
Re: [2005] Textbox resize
 Originally Posted by FireKnox101
On my form i have a multiline textbox named "txteditor", here is my problem when i hit then maximize button the textbox dosent change size? here is the code im using.
VB Code:
txteditor.width = me.width
txtedirot.height = me.height
Im using vb.net 2005 express 
Hi,
I should do it this way;
VB Code:
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
txtedirot.Size = New Size(500, 50)
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
txtedirot.Size = New Size(50, 250)
End Sub
You must set the Multiline = true for your Textbox
Hope it helps,
sparrow1
Last edited by sparrow1; Jul 5th, 2006 at 10:01 AM.
-
Jul 5th, 2006, 04:30 PM
#4
Re: [2005] Textbox resize
 Originally Posted by sparrow1
You must set the Multiline = true for your Textbox
That's also a relatively important point.
-
Jul 5th, 2006, 04:33 PM
#5
Re: [2005] Textbox resize
based on the code provided by the original poster.. this sounds like the textbox should have its dock property set to fill, and that should give the desired result.
I am just basing that on the fact that their code implies making the textbox the same size as the form....
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|