RELATEED CONSULTING
相关咨询
选择下列产品马上在线沟通
服务时间:8:30-17:00
你可能遇到了下面的问题
关闭右侧工具栏

新闻中心

这里有您想知道的互联网营销解决方案
关于vb点虐 亮灭效果的信息

VB.NET关键字上色/高亮问题。

Private Sub RichTextBox1_TextChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RichTextBox1.TextChanged

创新互联公司专注于网站建设|成都网站维护|优化|托管以及网络推广,积累了大量的网站设计与制作经验,为许多企业提供了网站定制设计服务,案例作品覆盖纯水机等行业。能根据企业所处的行业与销售的产品,结合品牌形象的塑造,量身开发品质网站。

Dim pos = RichTextBox1.SelectionStart

Dim i As String = Regex.Matches(RichTextBox1.Text, "\bDim\b").ToString

RichTextBox1.SelectAll

RichTextBox1.SelectionColor = Color.Black

If Regex.IsMatch(RichTextBox1.Text, "\bDim\b") = True Then

For Each mat As Match In Regex.Matches(RichTextBox1.Text, "\bDim\b")

RichTextBox1.SelectionStart = mat.Index

RichTextBox1.SelectionLength = mat.Length

RichTextBox1.SelectionColor = Color.YellowGreen

Next

End If

RichTextBox1.SelectionStart = pos

RichTextBox1.SelectionLength = 0

End Sub

我做了一个更详细的正则:

Friend Keys As String =

"\b(#Const|#If|Then|#Else|#Region|Delegate|Namespace|Class|End|Firend|Partial|Module|Interface|Enum|Shared|Overrides|Overloads|Structure|Let|Const|Dim|As|Private|Public|New|Static|Option|Private|Module|IsArray|IsDate|IsEmpty|IsError|IsMissing|IsNull|IsNumeric|IsObject|TypeName|VarType|Me|Option|Explicit|Mod|Like|Is|Not|And|Or|Xor|Eqv|Imp|Clear|Error|Raise|Error|Err|CVErr|On|Error|Resume|IsError|Collection|Add|Remove|Item|DDB|SLN|SYD|FV|Rate|IRR|MIRR|NPer|IPmt|Pmt|PPmt|NPV|PV|Do|Loop|For|Next|For|Each|Next|While|Wend|With|Choose|If|Then|Else|Select|Case|Switch|Call|Function|Property|Get|Property|Let|Property|Set|Sub|Date|Now|Time|DateAdd|DateDiff|DatePart|DateSerial|DateValue|TimeSerial|TimeValue|Date|Time|Timer|CBool|CByte|CCur|CDate|CDbl|CDec|CInt|CLng|CSng|CStr|CVar|CVErr|Fix|Int|Boolean|Byte|Currency|Date|Double|Integer|Long|Object|Single|String|Object|Atn|Cos|Sin|Tan|Exp|Log|Sqr|Randomize|Rnd|Abs|Sgn|Fix|Int|IsArray|Array|Option|Base|Dim|Private|Public|ReDim|Static|LBound|UBound|Erase|ReDim|DeleteSetting|GetSetting|GetAllSettings|SaveSetting|Chr|Format|LCase|UCase|DateSerial|DateValue|Hex|Oct|Format|Str|CBool|CByte|CCur|CDate|CDbl|CDec|CInt|CLng|CSng|CStr|CVar|CVErr|Fix|Int|Day|Month|Weekday|Year|Hour|Minute|Second|Asc|Val|TimeSerial|TimeValue|StrComp|StrConv|Format|LCase|UCase|Space|String|Len|Format|LSet|RSet|InStr|Left|LTrim|Mid|Right|RTrim|Trim|Option|Compare|Asc|Chr|AppActivate|Shell|SendKeys|Beep|Command)\b"

vb点虐 串口点亮小灯

SCON = 0x50; //REN=1允许串行接受状态,串口工作模式1 TMOD|= 0x20; 试下这个程序,PC发什么,它就回送什么,收到数据,点亮P2.0的LED。

vb点虐 高亮度显示文本

选中就是高亮,首先得到你找到的文本字符的起始位置和长度,然后

TextBox.Select(start,length)

TextBox.SelectionStart = start

TextBox.SelectionLength = length

[VB.NET]如何用VB在窗体中实现闪烁文字

通过使用VB的Timer控件,程序员可以轻松的在窗体上实现闪烁文字的效果。本文将演示如何为Label控件加上闪烁效果,这种方法同样适用于其它多种控件。以下代码可以完成检验ForeColor属性的任务: Private Sub Timer1_Timer() If Label1.ForeColor = Label1.BackColor Then Label1.ForeColor = vbBlack Else Label1.ForeColor = Label1.BackColor End If End Sub 另外,你也可以让文字采用不同的颜色,比如交替采用红色和绿色: Private Sub Timer1_Timer() If Label1.ForeColor = vbRed Then Label1.ForeColor = vbGreen Else Label1.ForeColor = vbRed End If End Sub 当你停止文字闪烁时,还要确定文字的状态是可见的并且采用了合适的色彩。


文章标题:关于vb点虐 亮灭效果的信息
网页地址:http://sczitong.cn/article/ddedish.html