"Sticking Together" isnt the best phrase but i dont know what to call it but im making a kind of notepad basicly and i want to textbox to stick to the form so when the form is resized so is the textbox,, Look at MS Notepad for an example...
Cheers
Printable View
"Sticking Together" isnt the best phrase but i dont know what to call it but im making a kind of notepad basicly and i want to textbox to stick to the form so when the form is resized so is the textbox,, Look at MS Notepad for an example...
Cheers
In the Form_Resize event, simply resize the textbox to whatever size you need.
Example: Create a new project and drop a textbox onto it then put this code in the form module:
VB Code:
Private Sub Form_Resize() Text1.Move 0, 0, Me.Width - 90, Me.Height - 390 End Sub
Run the project and you'll see how the textbox resizes with the form.
In the Resize event of the form, change the height & width of the text box to match.... but be sure to check the WindowState property first.... make sure it isn't set to Minimize.
Tg
Well, you would have to resize the control using the Form_Resize sub... I used something like this in mine:
VB Code:
Private Sub Form_Resize() On Error Resume Next If frmMainForm.WindowState = vbMinimized Then Exit Sub Else TextBox1.Top = 5 TextBox1.Left = 5 TextBox1.Height = (Me.ScaleHeight - 5) TextBox1.Width = (Me.ScaleWidth - 5) End If End Sub
You could do something like that but, you'd need to tweek it a bit :)
Cheers,
RyanJ
ACE!! :thumb: