在VB中设计菜单时,全选代码该怎么写?还有查找替换代码??

解决方案 »

  1.   

    是要做记事本之类的东东吧,看这里:
    http://www.xker.com/article/articleview/2005-4-15/article_view_831.htm
      

  2.   

    楼主是什么意思?
      你选、菜单要全选的话就这样写
     假设对txt操作
    Private Sub ComSlect_Click()
      Text1.SetFocus
      Text1.SelStart = 1
      Text1.SelLength = Len(Text1.Text)
      
    End Sub替换操作。
       s= text1.text
      replace(s,"Badword")
      

  3.   

    查找:假设在文本框TEXT1里找STR
    Private Sub subFIND(str as string)
    dim i as long
    i=instr(text1,str)
    if i>0 then  
      Text1.SelStart = i
      Text1.SelLength = Len(str)
    else
    msgbox "Not found."
    end if
    End Sub