主题:求教 自下而上文字滚动 的问题
下了一个自下而上滚动文字的控件,能很好的实现
但是如果文字多了,就会变得很慢很吃系统资源,其他的功能都慢得没法响应了,请问有什么办法解决么
调用代码
Dim s As String
Open a For Input As #1
Do While Not EOF(1)
Line Input #1, tmp
cap = cap & tmp & vbCrLf & vbCrLf
Loop
Close #1
scroltext1.Caption = cap
scroltext1.scrolstart
控件代码
Private Sub Timer1_Timer()
Label1.Top = Label1.Top - 5
If Label1.Top < -Label1.Height Then
Label1.Top = UserControl.ScaleHeight
End If
End Sub
Private Sub UserControl_Resize()
Label1.Top = UserControl.ScaleHeight
Label1.Left = 0
Label1.Width = UserControl.ScaleWidth
End Sub
Public Property Get Font() As Font
'Set Font = Label1.Font
End Property
Public Property Set Font(ByVal New_Font As Font)
'Set Label1.Font = New_Font
'PropertyChanged "Font"
End Property
Public Property Get ForeColor() As OLE_COLOR
'ForeColor = Label1.ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
'Label1.ForeColor() = New_ForeColor
' PropertyChanged "ForeColor"
End Property
Public Property Get Caption() As String
Caption = Label1.Caption
End Property
Public Property Let Caption(ByVal New_Caption As String)
Label1.Caption() = New_Caption
PropertyChanged "Caption"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
'Set Font = PropBag.ReadProperty("Font", Ambient.Font)
'Label1.ForeColor = PropBag.ReadProperty("ForeColor", &HFFFF&)
Label1.Caption = PropBag.ReadProperty("Caption", "Control By Daxesh Tailor")
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Font", Font, Ambient.Font)
Call PropBag.WriteProperty("ForeColor", Label1.ForeColor, &HFFFF&)
Call PropBag.WriteProperty("Caption", Label1.Caption, "Control By Daxesh Tailor")
End Sub
Public Sub scrolstart()
Timer1.Interval = 10
End Sub
Public Sub scrolstop()
Timer1.Interval = 0
End Sub
急,我是新手,求各位大大帮个忙,顺便祝大家新年快乐
但是如果文字多了,就会变得很慢很吃系统资源,其他的功能都慢得没法响应了,请问有什么办法解决么
调用代码
Dim s As String
Open a For Input As #1
Do While Not EOF(1)
Line Input #1, tmp
cap = cap & tmp & vbCrLf & vbCrLf
Loop
Close #1
scroltext1.Caption = cap
scroltext1.scrolstart
控件代码
Private Sub Timer1_Timer()
Label1.Top = Label1.Top - 5
If Label1.Top < -Label1.Height Then
Label1.Top = UserControl.ScaleHeight
End If
End Sub
Private Sub UserControl_Resize()
Label1.Top = UserControl.ScaleHeight
Label1.Left = 0
Label1.Width = UserControl.ScaleWidth
End Sub
Public Property Get Font() As Font
'Set Font = Label1.Font
End Property
Public Property Set Font(ByVal New_Font As Font)
'Set Label1.Font = New_Font
'PropertyChanged "Font"
End Property
Public Property Get ForeColor() As OLE_COLOR
'ForeColor = Label1.ForeColor
End Property
Public Property Let ForeColor(ByVal New_ForeColor As OLE_COLOR)
'Label1.ForeColor() = New_ForeColor
' PropertyChanged "ForeColor"
End Property
Public Property Get Caption() As String
Caption = Label1.Caption
End Property
Public Property Let Caption(ByVal New_Caption As String)
Label1.Caption() = New_Caption
PropertyChanged "Caption"
End Property
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
'Set Font = PropBag.ReadProperty("Font", Ambient.Font)
'Label1.ForeColor = PropBag.ReadProperty("ForeColor", &HFFFF&)
Label1.Caption = PropBag.ReadProperty("Caption", "Control By Daxesh Tailor")
End Sub
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Call PropBag.WriteProperty("Font", Font, Ambient.Font)
Call PropBag.WriteProperty("ForeColor", Label1.ForeColor, &HFFFF&)
Call PropBag.WriteProperty("Caption", Label1.Caption, "Control By Daxesh Tailor")
End Sub
Public Sub scrolstart()
Timer1.Interval = 10
End Sub
Public Sub scrolstop()
Timer1.Interval = 0
End Sub
急,我是新手,求各位大大帮个忙,顺便祝大家新年快乐