Guidance
指路人
g.yi.org
software / rapidq / examples / gui / Edit & Richedit / SearchRich.bas

Register 
注册
Search 搜索
首页 
Home Home
Software
Upload

  
     DECLARE FUNCTION SetFocus LIB "USER32" ALIAS "SetFocus" (HWnd AS LONG) AS LONG
     DECLARE SUB Search

     CREATE Form AS QFORM
      CAPTION = "Form"
      Width = 320
      Height = 200
      Center
      CREATE Rich AS QRICHEDIT
       Left = 60
       Top = 31
       Height = 50
       AddStrings "noise one noise"
       AddStrings "noise two noise"
       AddStrings "noise three noise"
       SelStart = 0
       Scrollbars = 3
       HideSelection = 1
      END CREATE
      CREATE Poor AS QEDIT
       Left = 90
       Top = 90
       Text = "Type word then ENTER"
      END CREATE
      CREATE Invisible AS QBUTTON
       Top = 120
       Left = 110
       CAPTION = "Search"
       Default = 1  'no ding
       OnClick = Search
      END CREATE
      SHOWMODAL
     END CREATE

     SUB Search
      DEFLNG start
      where = INSTR(start,Rich.Text,Poor.Text)
      IF where <> 0 THEN
       SetFocus(Rich.Handle)
       Rich.SelStart = where - 1
       Rich.SelLength = LEN(Poor.Text)  'comment this out if you want cursor only
       start = where + LEN(Poor.Text)
      ELSE
       SHOWMESSAGE "No more instances of " + Poor.Text
       start = 0
      END IF
     END SUB
掌柜推荐
 
 
¥317.00 ·
 
 
¥470.00 ·
 
 
¥880.00 ·
 
 
¥1,480.00 ·
 
 
¥1,380.00 ·
 
 
¥294.00 ·
© Mon 2024-11-25  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0 Last modified:2001-11-24 02:25:12