网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

vb.net查找错字 vb查找字符串位置

怎么编制vb程序快速的查找文中的错别字

1、找一份词库

成都创新互联公司长期为数千家客户提供的网站建设服务,团队从业经验10年,关注不同地域、不同群体,并针对不同对象提供差异化的产品和服务;打造开放共赢平台,与合作伙伴共同营造健康的互联网生态环境。为梅县企业提供专业的网站设计制作、成都做网站梅县网站改版等技术服务。拥有10余年丰富建站经验和众多成功案例,为您定制开发。

2、在“文中”进行分词、匹配

.net和java都有比较成熟的分词和词库,vb实现比较费时

VB查找关键字

Dim number As Long

Private Function FindStr(ByVal SLeft As Long, ByVal SFind As String, ByVal SSFind As String)

If Len(SFind) Len(SSFind) - SLeft Then

FindStr = -1

Exit Function

Else

FindStr = InStr(SLeft + 1, SSFind, SFind) - 1

End If

End Function

Private Sub Command1_Click()

number = FindStr(0, Text1.Text, RichTextBox1.Text)

If number = -1 Then

MsgBox "没有找到"

Command2.Enabled = False

Else

RichTextBox1.SelStart = number

RichTextBox1.SelLength = Len(Text1.Text)

Command2.Enabled = True

End If

End Sub

Private Sub Command2_Click()

number = FindStr(number + Len(Text1.Text), Text1.Text, RichTextBox1.Text)

If number = -1 Then

MsgBox "查找完毕"

Command2.Enabled = False

Else

RichTextBox1.SelStart = number

RichTextBox1.SelLength = Len(Text1.Text)

Command2.Enabled = True

End If

End Sub

注意RichTextBox1.HideSelection要设为false

vb.net DataGridView关于查找问题

遍历datagridview的单元格,判断单元格内的值是否与textbox的text相等。

foreach (DataGridViewRow row in dataGridView1.Rows)

{

foreach(DataGridViewCell cell in row)

{

if(cell.value = textbox1.text) then

cell.focus()

else

msg("没有找到相关信息")

}

}

在VB.NET中怎么用InputBox实现查找功能

dim str1 ,str2 as string

dim n as integer

str2=inputbox("请输入要查找的字符:")

for n=1 to len(textbox1.text)

str1=mid(textbox1.text,n,1)

if str2=str1 then

msgbox("找到啦!")

exit for

end if

next

if n=len(textbox1.text)+1 then

msgbox("没有你要找的字符!")

end if


当前名称:vb.net查找错字 vb查找字符串位置
链接分享:http://bjjierui.cn/article/dddgpcp.html

其他资讯