跪求VB高手,我的扣扣691876575,关于设计滚动字幕板的。
(1)启动程序,同时显示图1、图2所示的2个参考界面,窗口1用来显示滚动字幕的显示板,窗口2是控制板。(2)单击控制窗口中的“开始滚动”按钮,显示窗口中的文字开始滚动显示...
(1)启动程序,同时显示图1、图2所示的2个参考界面,窗口1用来显示滚动字幕的显示板,窗口2是控制板。 (2)单击控制窗口中的“开始滚动”按钮,显示窗口中的文字开始滚动显示。滚动的方式由控制窗口中的“字幕滚动方向控制”框中的4个单选框决定。“滚动字幕的文字大小控制”框可以控制字体大小。“滚动字幕字体控制”是4个按钮式样的单选框,用于设置字体样式。
(3)本程序提供8中内置文字内容,单击“内置文字”框中的任一个按钮可以改变字幕的内容。如果要显示自定义的文字内容,可以直接在底部文本框中输入,然后回车即可。
(4)通过“前景色”和“背景色”组合框(图3所示),可以改变滚动字幕的前景色和背景色。若选择“颜色自动变化”复选框,则滚动字幕的前景色和背景色均自动变化(每1s变化一次)。
(5)单击控制板“隐藏控制板” 按钮可将控制窗口隐藏只显示显示板,双击显示板可以重新显示控制板。单击控制板“退出”按钮同时关闭两个窗口,程序结束。 展开
(3)本程序提供8中内置文字内容,单击“内置文字”框中的任一个按钮可以改变字幕的内容。如果要显示自定义的文字内容,可以直接在底部文本框中输入,然后回车即可。
(4)通过“前景色”和“背景色”组合框(图3所示),可以改变滚动字幕的前景色和背景色。若选择“颜色自动变化”复选框,则滚动字幕的前景色和背景色均自动变化(每1s变化一次)。
(5)单击控制板“隐藏控制板” 按钮可将控制窗口隐藏只显示显示板,双击显示板可以重新显示控制板。单击控制板“退出”按钮同时关闭两个窗口,程序结束。 展开
3个回答
展开全部
1 . api声明
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Type ROWRECT
oRT As RECT
sa As String
bMove As Boolean
sOld As String
End Type
Public Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As Long) As Long
' To set fram control as the parent of the slide show window
Public Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Public Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const HWND_TOPMOST = -1&
Public Const HWND_NOTOPMOST = -2&
Public Const SWP_NOSIZE = &H1&
Public Const SWP_NOMOVE = &H2&
Public Const SWP_NOACTIVATE = &H10&
Public Const SWP_SHOWWINDOW = &H40&
Public Const DT_BOTTOM = &H8
Public Const DT_CALCRECT = &H400
Public Const DT_CENTER = &H1
Public Const DT_CHARSTREAM = 4 ' Character-stream, PLP
Public Const DT_DISPFILE = 6 ' Display-file
Public Const DT_EXPANDTABS = &H40
Public Const DT_EXTERNALLEADING = &H200
Public Const DT_INTERNAL = &H1000
Public Const DT_LEFT = &H0
Public Const DT_METAFILE = 5 ' Metafile, VDM
Public Const DT_NOCLIP = &H100
Public Const DT_NOPREFIX = &H800
Public Const DT_PLOTTER = 0 ' Vector plotter
Public Const DT_RASCAMERA = 3 ' Raster camera
Public Const DT_RASDISPLAY = 1 ' Raster display
Public Const DT_RASPRINTER = 2 ' Raster printer
Public Const DT_RIGHT = &H2
Public Const DT_SINGLELINE = &H20
Public Const DT_TABSTOP = &H80
Public Const DT_TOP = &H0
Public Const DT_VCENTER = &H4
Public Const DT_WORDBREAK = &H10
Public Const SFGJDepID = "20100000018"
Public Const SGSJDepID = "20100000021"
2 模块变量声明
Dim moRectA() As ROWRECT
Dim moRectB() As ROWRECT
Dim mBchange As Boolean
3 timer 控件中的代码示例
PicA.Cls
picB.Cls
If miChange Mod 100 = 0 Then s_loadData
For iA = 0 To miRows - 1
If moRectA(iA).sa <> "" Then
If moRectA(iA).bMove Then moRectA(iA).oRT.Left = moRectA(iA).oRT.Left - 2
If moRectA(iA).oRT.Left < 80 - miColWidth Then
moRectA(iA).oRT.Left = miColWidth - 80
End If
moRectA(iA).oRT.Right = moRectA(iA).oRT.Left + miColWidth
DrawText PicA.hdc, moRectA(iA).sa, -1, moRectA(iA).oRT, DT_CENTER Or DT_WORDBREAK
End If
If moRectB(iA).sa <> "" Then
If moRectB(iA).bMove Then moRectB(iA).oRT.Left = moRectB(iA).oRT.Left - 2
If moRectB(iA).oRT.Left < 80 - miColWidth Then
moRectB(iA).oRT.Left = miColWidth - 80
End If
moRectB(iA).oRT.Right = moRectB(iA).oRT.Left + miColWidth
DrawText picB.hdc, moRectB(iA).sa, -1, moRectB(iA).oRT, DT_CENTER Or DT_WORDBREAK
End If
Public Type RECT
Left As Long
Top As Long
Right As Long
Bottom As Long
End Type
Public Type ROWRECT
oRT As RECT
sa As String
bMove As Boolean
sOld As String
End Type
Public Declare Function FindWindow Lib "user32" _
Alias "FindWindowA" (ByVal lpClassName As String, _
ByVal lpWindowName As Long) As Long
' To set fram control as the parent of the slide show window
Public Declare Function SetParent Lib "user32" _
(ByVal hWndChild As Long, _
ByVal hWndNewParent As Long) As Long
Public Declare Function DrawText Lib "user32" Alias "DrawTextA" (ByVal hdc As Long, ByVal lpStr As String, ByVal nCount As Long, lpRect As RECT, ByVal wFormat As Long) As Long
Declare Function SetWindowPos Lib "user32" (ByVal hwnd As Long, _
ByVal hWndInsertAfter As Long, ByVal X As Long, ByVal Y As Long, _
ByVal cx As Long, ByVal cy As Long, ByVal wFlags As Long) As Long
Public Const HWND_TOPMOST = -1&
Public Const HWND_NOTOPMOST = -2&
Public Const SWP_NOSIZE = &H1&
Public Const SWP_NOMOVE = &H2&
Public Const SWP_NOACTIVATE = &H10&
Public Const SWP_SHOWWINDOW = &H40&
Public Const DT_BOTTOM = &H8
Public Const DT_CALCRECT = &H400
Public Const DT_CENTER = &H1
Public Const DT_CHARSTREAM = 4 ' Character-stream, PLP
Public Const DT_DISPFILE = 6 ' Display-file
Public Const DT_EXPANDTABS = &H40
Public Const DT_EXTERNALLEADING = &H200
Public Const DT_INTERNAL = &H1000
Public Const DT_LEFT = &H0
Public Const DT_METAFILE = 5 ' Metafile, VDM
Public Const DT_NOCLIP = &H100
Public Const DT_NOPREFIX = &H800
Public Const DT_PLOTTER = 0 ' Vector plotter
Public Const DT_RASCAMERA = 3 ' Raster camera
Public Const DT_RASDISPLAY = 1 ' Raster display
Public Const DT_RASPRINTER = 2 ' Raster printer
Public Const DT_RIGHT = &H2
Public Const DT_SINGLELINE = &H20
Public Const DT_TABSTOP = &H80
Public Const DT_TOP = &H0
Public Const DT_VCENTER = &H4
Public Const DT_WORDBREAK = &H10
Public Const SFGJDepID = "20100000018"
Public Const SGSJDepID = "20100000021"
2 模块变量声明
Dim moRectA() As ROWRECT
Dim moRectB() As ROWRECT
Dim mBchange As Boolean
3 timer 控件中的代码示例
PicA.Cls
picB.Cls
If miChange Mod 100 = 0 Then s_loadData
For iA = 0 To miRows - 1
If moRectA(iA).sa <> "" Then
If moRectA(iA).bMove Then moRectA(iA).oRT.Left = moRectA(iA).oRT.Left - 2
If moRectA(iA).oRT.Left < 80 - miColWidth Then
moRectA(iA).oRT.Left = miColWidth - 80
End If
moRectA(iA).oRT.Right = moRectA(iA).oRT.Left + miColWidth
DrawText PicA.hdc, moRectA(iA).sa, -1, moRectA(iA).oRT, DT_CENTER Or DT_WORDBREAK
End If
If moRectB(iA).sa <> "" Then
If moRectB(iA).bMove Then moRectB(iA).oRT.Left = moRectB(iA).oRT.Left - 2
If moRectB(iA).oRT.Left < 80 - miColWidth Then
moRectB(iA).oRT.Left = miColWidth - 80
End If
moRectB(iA).oRT.Right = moRectB(iA).oRT.Left + miColWidth
DrawText picB.hdc, moRectB(iA).sa, -1, moRectB(iA).oRT, DT_CENTER Or DT_WORDBREAK
End If
追问
你加我扣扣把,我把要求发给你,谢啦
追答
请照着例子自己做
AiPPT
2024-09-19 广告
2024-09-19 广告
随着AI技术的飞速发展,如今市面上涌现了许多实用易操作的AI生成工具1、简介:AiPPT: 这款AI工具智能理解用户输入的主题,提供“AI智能生成”和“导入本地大纲”的选项,生成的PPT内容丰富多样,可自由编辑和添加元素,图表类型包括柱状图...
点击进入详情页
本回答由AiPPT提供
展开全部
学习
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询