-
I am trying to make an HTML editor but I get stuck on little things because I'm a beginner.
I have a Text box (Text1), but it's too big for the form. I don't know how to make it go to the edge of the page and stop, using scroll bars from there on. thanks for any help.
-
Set the textboxe's Multiline property to TRUE, and notice that it has a Scrollbar property. Set that to Vertical (or whatever you want). See if that solves your problem.
-
size it
in design time you just stretch it to the size you want it or you can set it at run time using the left and top properties.
ie...look at your form properties and see what the left property reads for your form
let's say it is 100..then in your form app you could say
text1.left = 95
as for the height...check the property and see where it is and then adjust it accordingly
text1.top = 100
set the multiline property to true
and set the scrollbars to vertical or horizontal or both
Hope this helps..
to see the property box of an item click on the item in design time...hold down the ctrl key and r and the property box will pop up.
-
What about if it's maximized? Everyone's resolution is different. How would I say form width - 600?
-
if u want the text thing to fit the form when the form is maximized then
Private Sub Form_Resize()
Me.Text1.Height = Me.ScaleHeight
Me.Text1.Width = Me.ScaleWidth
End Sub
I HOPE THAT WORKS
IT BETTER WORK
-
DONT WORRY ABOUT RESOLUTION VB WILL TAKE CARE OF THAT
LEAVE IT TO MS - TO SCREW THINGS UP ;)
-
That did make it maximize, but now I can't see the scroll bars. when I write too much it just runs off the screen. How would I fix that?
-
First of all make sure that the text box top propery is 0 and left is also 0 if your project doesnt let you then or u the text box has to be away from the top or away from the side
see how much ur away from the top if ur 300 away then do this
Private Sub Form_Resize()
Me.Text1.Height = Me.ScaleHeight - 300
Me.Text1.Width = Me.ScaleWidth
End Sub
capish? hope it works
if ur left doesnt equeal 0 then
Private Sub Form_Resize()
Me.Text1.Height = Me.ScaleHeight
Me.Text1.Width = Me.ScaleWidth - (what ever left equals)
End Sub
or both
Private Sub Form_Resize()
Me.Text1.Height = Me.ScaleHeight - (what ever top equals)
Me.Text1.Width = Me.ScaleWidth - (what ever left equals)
End Sub