-
I'm working on a help section for a program I'm making and I want to keep it small and easy to use. (The program is mostly going to be used by computer illiterates).
As a result I'm wanting to keep the whole thing on a single window and have a list of labels on the left which can be scrolled through and when someone clicks on one of those labels it will update the a display area on the right
Now, I can handle everything but the scrolling. Anyone know how I can make the labels scroll up and down?
-
Not sure if this is what you want..but this scrolls a label ;].
Code:
Private Sub Form_Load()
Label1.Top = 0
End Sub
Private Sub Label1_Click()
If Label1.Top = 0 Then
Do Until Label1.Top = 5500
Label1.Top = Label1.Top + 1
Loop
ElseIf Label1.Top = 5500 Then
Do Until Label1.Top = 0
Label1.Top = Label1.Top - 1
Loop
End If
End Sub
-
You're close, I am wanting to scroll labels, but I have multiple labels, placed within a frame maybe, which I want to scroll as if in a textbox. That way it will appear to be one long continuous list of words or labels scolling as one. I would use a regular textbox, but I need each label to be its own link, like on a web page. And I chose a frame because I need it to be contained within a box.
-
I think I know. Scroll..like credits?
Code:
Private Sub Form_Load()
msg$ = "This is a simple Marquee example." & vbCrLf
msg$ = msg$ & "You can make something 100 times better."
MsgBox msg$, vbYes, "Marquee Example of Scrolling Text"
Label1.Visible = True
Label1.Enabled = True
Form1.Enabled = True
Label1.Caption = Date
Label1.Left = 0
Label1.Top = 1800
Label1.Height = 255
Label1.Width = 1195
Command1.Top = 2400
Command1.Left = 0
Command1.Height = 375
Command1.Width = 6705
Command1.Caption = "Exit Example"
Command1.Enabled = True
Command1.Visible = True
Form1.Height = 3225
Form1.Width = 6810
Timer1.Enabled = True
Timer1.Interval = 1
End Sub
Private Sub Timer1_Timer()
If Label1.Left < -1000 Then
Label1.Left = 7000
Else
Label1.Left = Val(Label1.Left) - 40
End If
End Sub
Private Sub Command1_Click()
'will give user a Yes or No prompt in which they wish to exit
Dim x As Integer
x = MsgBox("Are you sure you want to exit?", vbYesNo, "Exit")
If x = 6 Then
End
End If
End Sub
-
Well it's closer, but not quite right.
I'm going to have multiple labels, not just one. Is there a way to use each label contained within a picturebox or some other container? Then I can use a VScrollbar to take it from there.
-
Nice and easy.
What you do is you have all labels as an array(easiest). And you have the scroll bar have min be 0 and max be label1.ubound Each time the scroll bar changes do the following:
Code:
for x = label1.lbound to label1.ubound
label1(x).viable=false
next x
label1(hscroll1.value).viable=true
Hope this helps ;)
NOTE: This will only display one label at a time.
-
I don't think you guys are quite getting what he is after :(
Open NotePad...
Open a BIG text file
Notice how there is a scroll bar down the right hand side and that dragging it up and down "scrolls" the text in the middle?
Well I believe the lad would like this kind of functionality but instead of a page of "text" he wants a "Frame" that can have ANYTHING on it... Labels, TextBoxes, DropDowns, Graphics... WHATEVER.
So in otherwords its like a webpage that has more than just what you can see and so you "scroll" it down to see the rest.
I would also like to know if this is possible because it would interest myself as well.
-
Maybe I don't get this either but it shouldn't be that hard.
1) Make a frame, so it looks nice and tidy.
2) Put a picture box within the frame
3) Place all labels in the picturebox
4) Place a vertical scrollbar beside the frame
5) Insert code:
Code:
Private Sub Form_Resize()
frame1.Height = Me.Height - ctMargin
VScroll1.Max = (pic1.Height - frame1.Heigh) \ 150
End Sub
Code:
Private Sub VScroll1_Change()
pic1.Top = 0 - VScroll1.Value * 150
End Sub
Is that what you were looking for?
//Anders
[Edited by Anders Englund on 07-17-2000 at 02:51 AM]
-
Try using this.
All you need is a scrollbar...
You can download my Frame Scroller example from my site to check how it can be easily done.