注册 | 登录
收藏 | 帮助
热门文章
编辑推荐
相关文章  
消息称雅虎计划拒绝微软收购报价
雅虎公司董事会打算回绝微软收购
微软出价446亿美元洽购雅虎
微软推出OS X平台PS的HD Photo格
Microsoft AntiSpyware微软出品的
微软反间谍软件与恶意移除工具的
微软官方解读Vista安全性: 全面的
微软警告:SQL Server发现新安全
微软发表SQL Server的数据库认证
SQL Server 2000升级 微软发布SP
您现在的位置: 顶尖设计 >> IT学院 >> 编程开发 >> VB >> 文章正文
和微软一模一样的记事本的源代码(2)
作者:deak  来源:CSDN  点击:  更新:2006-12-19
简介:

 

Public Sub Command1_Click()
Dim FoundPos As Integer
If Fstring = "" Then
    Fstring = Text1.Text
Else
    If Text1.Text <> Fstring And Text1.Text <> "" Then
    Fstring = Text1.Text
    End If
   
End If

If Option1.Value = True Then
    EndPos = Form1.Text1.SelStart
    Form1.Text1.SelStart = 0
    StartPos = 0
    Do While FoundPos <> -1
        If Check1.Value = 1 Then
        FoundPos = Form1.Text1.Find(Fstring, StartPos, EndPos, 4)
            If FoundPos <> -1 Then StartPos = FoundPos + Len(Fstring)
        Else
        FoundPos = Form1.Text1.Find(Fstring, StartPos, EndPos)
            If FoundPos <> -1 Then StartPos = FoundPos + Len(Fstring)
        End If
    Loop
    If StartPos = 0 Then
       ' StartPos = StartPos - Len(Fstring)
          
   ' Else
       MsgBox "find   not   " + Chr(34) + Fstring + Chr(34)
    End If
Else
    StartPos = Form1.Text1.SelStart + Form1.Text1.SelLength
    EndPos = Len(Form1.Text1)
    If Check1.Value = 1 Then
        FoundPos = Form1.Text1.Find(Fstring, StartPos, EndPos, 4)
   
    Else
        FoundPos = Form1.Text1.Find(Fstring, StartPos, EndPos)
    End If
    If FoundPos <> -1 Then
        StartPos = FoundPos + 1
    Else
        MsgBox "find   not   " + Chr(34) + Fstring + Chr(34)
    End If
End If

End Sub

Private Sub Command2_Click()
Form2.Visible = False
End Sub

Private Sub Form_Load()
Command1.Enabled = False
Tchange = False
EndPos = LenB(Form1.Text1)
End Sub

Private Sub Text1_Change()

If Text1.Text <> "" Then
    Command1.Enabled = True
Else
    Command1.Enabled = False
   
End If
Tchange = True

End Sub






  • 上一篇文章:
  • 下一篇文章:
  • 分享此文:该页面添加到 Mister Wong 添加到雅虎Yahoo!收藏 Add to:Del.icio.us Post to Furl Digg this 添加到Google书签 reddit spurl blogmarks 365Key 评论  收藏  分享  打印
     我来说两句
    姓名:       验证码:   
    主页: 
    评分: 1分 2分 3分 4分 5分
    本频道近期热评文章:
      关于我们 | 联系我们 | 站点地图 | 广告投放 | 友情链接 | 在线留言 | 版权申明
    版权所有 © 2004-2007 顶尖设计(bobd.cn)
    未经授权禁止转载,摘编,复制本站内容或建立镜像. 沪ICP备07504942号 
    网络110
    报警服务