VS 2010 Express: How to maximize textbox on form every time?

bulrush

New member
Joined
Jun 8, 2012
Messages
1
Programming Experience
10+
Hi, it's been a while since I used VB4 to write a program. Now I have VS 2010 Express and I want to write a simple text editor.

My first question is, I have a text box I put onto a form with a menu strip. When the program is run, I want my text box (my main editing area) to be the biggest size on the form. How do I do this? Is there an automatic way to do this? Or do I have to set the text box's x, y, width, and height properties when the form loads? Which form event would I put this in? I cannot seem to find Form_Load or Form_Activate.

Also, every time the form gets bigger or smaller, the text box size should also change.

Thanks.

UPDATE: Here's the code I have in frmMain_Resize:
Private Sub frmMain_Resize(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Resize
txtMain.Location.X = 0 ' FIRST ERROR HERE
txtMain.Location.Y = 0
txtMain.Size.Width = frmMain.Size.Width
txtMain.Size.Height = frmMain.Size.Height

End Sub
but I'm getting an error in txtMain.Location.X=0. Error is "Expression is a value and therefore cannot be the target of an assignment."

frmMain = main editor form
txtMain = main text box to type text in
 
Last edited:
Back
Top