Guidance
指路人
g.yi.org
Guidance Forums / Rapid-Q Basic / jump within QRICHEDIT

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

  
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
Message1. jump within QRICHEDIT
#844
Posted by: qmark 2003-04-09 17:06:36
how can I jump within QRICHEDIT to a specific line

could'nt find any information in documentation
Message2. Re: jump within QRICHEDIT
#845
Posted by: guidance 2003-04-09 18:01:39
Consider win32api sendmessage to control QRichEdit:

http://g.yi.org/Software/RQ%20intro/Tips/#sre
http://g.yi.org/f.php?f=5659
Message3. Re: jump within QRICHEDIT
#846
Posted by: 2003-04-10 09:30:37
To do it without API calls try this:

DECLARE SUB Track
DECLARE SUB GoToLine

CREATE Form AS QFORM
   CREATE Box AS QRICHEDIT
      Align = 5
      HideSelection = 0
      LoadFromFile("test.txt")
   END CREATE
   CREATE Button AS QBUTTON
      Align = 2
      Caption = "Go to line 1"
      OnClick = GoToLine
   END CREATE
   CREATE TrackBar AS QTRACKBAR
      Align = 2
      Height = 20
      OnChange = Track
   END CREATE
   Center
   ShowModal
END CREATE

SUB Track
   TrackBar.Max = Box.LineCount
   Button.Caption = "Go to line " + STR$(TrackBar.Position)
END SUB         '#####

SUB GoToLine    '#####
   Line = TrackBar.Position - 1
   Box.SelStart = INSTR(Box.Text, Box.Line(Line)) - 1
   Box.SelLength = LEN(Box.Line(Line))
END SUB

As a variation, comment out the two lines marked '##### and see the difference.
Message4. Re: jump within QRICHEDIT
#847
Posted by: qmark 2003-04-10 14:12:15
thanks Alan seems to help me
Forum List • Thread List • Refresh • New Topic • Search • Previous • Next First 1 Last
掌柜推荐
 
 
¥1,390.00 ·
 
 
¥287.00 ·
 
 
¥410.00 ·
 
 
¥1,380.00 ·
 
 
¥1,080.00 ·
 
 
¥271.00 ·
© Sun 2024-11-24  Guidance Laboratory Inc.
Email:webmaster1g.yi.org Hits:0