Skip to content
切换导航条
切换导航条
当前项目
正在载入...
登录
刘韬
/
HZH_Controls
转到一个项目
切换导航栏
切换导航栏固定状态
项目
群组
代码片段
帮助
项目
活动
版本库
流水线
图表
问题
0
合并请求
0
维基
网络
创建新的问题
作业
提交
问题看板
文件
提交
网络
比较
分支
标签
Commit a383feea
由
冰封一夏
编写于
2020-09-16 11:38:12 +0800
由
Gitee
提交于
2020-09-16 11:38:12 +0800
浏览文件
选项
浏览文件
标签
下载
差异文件
!11 修改ucRollText控件添加改变文本是否重置位置
修改ucRollText控件添加改变文本是否重置位置
2 个父辈
856be76e
541e7118
显示空白字符变更
内嵌
并排
正在显示
1 个修改的文件
包含
31 行增加
和
7 行删除
HZH_Controls/HZH_Controls/Controls/Roll/UCRollText.cs
HZH_Controls/HZH_Controls/Controls/Roll/UCRollText.cs
查看文件 @
a383fee
...
...
@@ -14,13 +14,9 @@
// If you use this code, please keep this note.
// ***********************************************************************
using
System
;
using
System.Collections.Generic
;
using
System.Linq
;
using
System.Text
;
using
System.Windows.Forms
;
using
System.Drawing
;
using
System.Drawing.Drawing2D
;
using
System.ComponentModel
;
using
System.Drawing
;
using
System.Windows.Forms
;
namespace
HZH_Controls.Controls
{
...
...
@@ -100,7 +96,8 @@ namespace HZH_Controls.Controls
{
Graphics
g
=
this
.
CreateGraphics
();
var
size
=
g
.
MeasureString
(
value
,
this
.
Font
);
rectText
=
new
Rectangle
(
0
,
(
this
.
Height
-
rectText
.
Height
)
/
2
+
1
,
(
int
)
size
.
Width
,
(
int
)
size
.
Height
);
rectText
=
new
Rectangle
(
_ISChangeReset
?
0
:
rectText
.
X
,
(
this
.
Height
-
rectText
.
Height
)
/
2
+
1
,
(
int
)
size
.
Width
,
(
int
)
size
.
Height
);
}
else
{
...
...
@@ -115,6 +112,14 @@ namespace HZH_Controls.Controls
private
RollStyle
_RollStyle
=
RollStyle
.
LeftToRight
;
/// <summary>
/// 文本改变是否重新从边缘运动
/// </summary>
private
bool
_ISChangeReset
=
false
;
/// <summary>
/// Gets or sets the roll style.
/// </summary>
/// <value>The roll style.</value>
...
...
@@ -137,6 +142,20 @@ namespace HZH_Controls.Controls
}
}
[
Description
(
"文本改变是否重新从边缘运动"
),
Category
(
"自定义"
)]
public
bool
ISChangeReset
{
get
{
return
_ISChangeReset
;
}
set
{
_ISChangeReset
=
value
;
}
}
/// <summary>
/// The move step
/// </summary>
...
...
@@ -158,7 +177,9 @@ namespace HZH_Controls.Controls
set
{
if
(
value
<=
0
)
{
return
;
}
_moveSleepTime
=
value
;
m_timer
.
Interval
=
value
;
...
...
@@ -213,7 +234,10 @@ namespace HZH_Controls.Controls
void
m_timer_Tick
(
object
sender
,
EventArgs
e
)
{
if
(
rectText
==
Rectangle
.
Empty
)
{
return
;
}
if
(
_RollStyle
==
HZH_Controls
.
Controls
.
RollStyle
.
BackAndForth
&&
rectText
.
Width
>=
this
.
Width
)
{
return
;
...
...
编写
预览
支持
Markdown
格式
附加文件
你添加了
0
人
到此讨论。请谨慎行事。
Finish editing this message first!
Cancel
请
注册
或
登录
后发表评论