|
-
Apr 18th, 2005, 04:01 PM
#1
Thread Starter
Addicted Member
Sticking together text box to form[RESOLVED]
"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
Last edited by WilliamRobinson; Apr 18th, 2005 at 04:18 PM.
Nothing is Impossible you say?......Try slamming a revolving door!
-
Apr 18th, 2005, 04:12 PM
#2
Fanatic Member
Re: Sticking together text box to form
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.
-
Apr 18th, 2005, 04:14 PM
#3
Re: Sticking together text box to 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
-
Apr 18th, 2005, 04:16 PM
#4
Re: Sticking together text box to form
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
-
Apr 18th, 2005, 04:17 PM
#5
Thread Starter
Addicted Member
Re: Sticking together text box to form
ACE!!
Nothing is Impossible you say?......Try slamming a revolving door!
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
|