View Full Version : Visual Basic
Grundy
12-17-2002, 01:57 PM
Does anyone know how to link a scroll bar with a textbox in Visual Basic? There is more text than will fit in the textbox and I need a scroll bar in order to scroll down and see the rest of the text. I don't want to change the size of the textbox so I need a scroll bar.
Any help?
------------------
JK SP - Rescue From Reidanta's Moon (http://massassi.net/levels/files/1017.shtml)
JO Duel - Sanity's Crossing (http://massassi.net/levels/files/2382.shtml)
JO FFA - Molten Lava Catacombs (http://massassi.net/levels/files/2439.shtml)
JO CTF - Kothlis Colossus (http://www.massassi.net/levels/files/2480.shtml)
i dont know about VB, but in delphi, "Scrollbars" is an option for the text box... for example
Memo1.Scrollbars := ssVertical
of course, its probably not ssVertical, ssHorizontal or ssBoth in VB... but probably something similar.
Grundy
12-17-2002, 03:57 PM
That code worked except for the scrolling command. I still need help on that part.
Text1.Scrollbar = ???
------------------
JK SP - Rescue From Reidanta's Moon (http://massassi.net/levels/files/1017.shtml)
JO Duel - Sanity's Crossing (http://massassi.net/levels/files/2382.shtml)
JO FFA - Molten Lava Catacombs (http://massassi.net/levels/files/2439.shtml)
JO CTF - Kothlis Colossus (http://www.massassi.net/levels/files/2480.shtml)
lordvader
12-17-2002, 04:32 PM
Try vbHorizontal, vbVertical, or vbBoth.
------------------
Capitalization (http://webster.commnet.edu/grammar/capitals.htm)
Commas (http://webster.commnet.edu/grammar/commas.htm)
Periods (http://webster.commnet.edu/grammar/marks/period.htm)
Question Marks (http://webster.commnet.edu/grammar/marks/question.htm)
Apostrophes (http://webster.commnet.edu/grammar/marks/apostrophe.htm)
Confusable Words (http://webster.commnet.edu/grammar/notorious.htm)
Plague Words (http://webster.commnet.edu/grammar/plague.htm)
Grundy
12-18-2002, 01:50 PM
VB seems to recognize vbVertical etc. because it automatically capitalizes "Vertical" but when I run the program, the text in the textbox doens't scroll and it comes up with an error message that says "Compile Error: Can't asign to read-only property."
Private Sub VScroll1_Scroll()
txtFact.ScrollBars = vbBoth
End Sub
Is there anyway to link the scrolbar with the textbox?
TwistedSoul
12-20-2002, 09:00 AM
ill be in programming very shortly but all you would need to do is
txtname.Vscroll = true
.....
or simply enabled the verticle scroller in the objects property window.
TwistedSoul
12-20-2002, 09:48 AM
heres a way to link them sort of.
Option Explicit
Private Sub Command1_Click()
If Text1.ScrollBars = 2 Then
Text1.Text = "This has a verticle scrollbar"
End If
End Sub
lordvader
12-20-2002, 03:53 PM
Ah, sorry, you're not able to dynamically change scrollbar setup; ScrollBars is a read-only property. Change the value in the object properties box.
------------------
Capitalization (http://webster.commnet.edu/grammar/capitals.htm)
Commas (http://webster.commnet.edu/grammar/commas.htm)
Periods (http://webster.commnet.edu/grammar/marks/period.htm)
Question Marks (http://webster.commnet.edu/grammar/marks/question.htm)
Apostrophes (http://webster.commnet.edu/grammar/marks/apostrophe.htm)
Confusable Words (http://webster.commnet.edu/grammar/notorious.htm)
Plague Words (http://webster.commnet.edu/grammar/plague.htm)
vBulletin® v3.7.3, Copyright ©2000-2008, Jelsoft Enterprises Ltd.