0
A
回答
0
下面是一個簡單的程序,將滾動消息。將以下內容放在prg文件中並運行它。
我會做一個containerScrollArea封裝計時器,標籤和滾動代碼的類。給它GetNextMessage方法,您可以覆蓋以檢索消息。
* Put a container on the screen to hold our scroller
_screen.AddObject("containerScrollArea", "container")
WITH _Screen.containerScrollArea
* Size it
.Visible = .t.
.Width = 100
.Height = 100
* Add two labels, one to hold each scrolling message
.AddObject("labelScroll1", "Label")
.AddObject("labelScroll2", "Label")
* This timer will move the labels to scroll them
.AddObject("timerScroller", "ScrollTimer")
ENDWITH
WITH _Screen.containerScrollArea.labelScroll1
* The labels are positioned below the margin of the container, so they're not initially visible
.Top = 101
.Height = 100
.Visible = .t.
.WordWrap = .t.
.BackStyle= 0
.Caption = "This is the first scrolling text, which is scrolling."
ENDWITH
WITH _Screen.containerScrollArea.labelScroll2
* The labels are positioned below the margin of the container, so they're not initially visible
.Top = 200
.Height = 100
.Visible = .t.
.WordWrap = .t.
.BackStyle= 0
.Caption = "This is the second scrolling text, which is scrolling."
ENDWITH
* Start the timer, which scrolls the labels
_Screen.containerScrollArea.timerScroller.Interval = 100
DEFINE CLASS ScrollTimer AS Timer
PROCEDURE Timer
* If the first label is still in view, move it by one pixel
IF This.Parent.labelScroll1.Top > -100
This.Parent.labelScroll1.Top = This.Parent.labelScroll1.Top - 1
ELSE
* If the first label has scrolled out of view on the top of the container, move it back to the bottom.
This.Parent.labelScroll1.Top = 101
* Load some new text here
ENDIF
IF This.Parent.labelScroll2.Top > -100
* If the second label is still in view, move it by one pixel
This.Parent.labelScroll2.Top = This.Parent.labelScroll2.Top - 1
ELSE
* If the second label has scrolled out of view on the top of the container, move it back to the bottom.
This.Parent.labelScroll2.Top = 101
* Load some new text here
ENDIF
ENDPROC
ENDDEFINE
0
您可以使用Scrollable Container
0
不幸的是我的工作性質讓我沒有時間與圖形鬼混,但如果我這樣做我會考慮使用GDI + VFP用。這裏有一個article讓你開始吧
相關問題
- 1. 滾動垂直
- 2. 垂直滾動條
- 3. FlowPanel垂直滾動
- 4. 垂直滾動SIlverlight
- 5. Phonegap垂直滾動
- 6. Android - 垂直滾動?
- 7. 垂直滾動條
- 8. Android垂直滾動
- 9. SWFLoader垂直滾動
- 10. jquery垂直滾動
- 11. Div垂直滾動
- 12. ICSharpCode.TextEditor垂直滾動
- 13. Viewpager垂直滾動
- 14. 垂直viewpager垂直滾動型
- 15. 垂直Android TabLayout不垂直滾動
- 16. LWUIT水平列表滾動垂直滾動垂直窗體
- 17. 垂直滾動的水平滾動條
- 18. 滾動視圖中的垂直滾動
- 19. Silverlight中的垂直滾動
- 20. 垂直滾動的Android ImageSwitcher
- 21. SettingFlyout的垂直滾動條
- 22. 垂直自動滾動Textview
- 23. 移動和滾動垂直
- 24. 垂直滾動條動畫
- 25. 字幕垂直對齊
- 26. 滾動垂直滾動條jquery
- 27. 離子滾動不會垂直滾動
- 28. 滾動型不垂直滾動
- 29. 水平滾動和垂直滾動
- 30. 垂直滾動和水平滾動