Guidance
指路人
g.yi.org
software / rapidq / Examples / GUI / Edit & Richedit / QRichEdit SaveToFile.bas

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

  
'from: "daxziz" Fri, 31 Oct 2003 18:02:41 -0000
' savetofile

     $INCLUDE "RAPIDQ.INC"

     DIM SAVEDIALOG AS QSAVEDIALOG
     SAVEDIALOG.Filter = "*.txt"

     DECLARE SUB SAVETEXT
     DECLARE SUB QUITAPPLICATION

     CREATE Form AS QFORM
      CAPTION = "RichEdit"
      Width = 564
      Height = 485
      Center
      CREATE MAINMENU AS QMAINMENU
       CREATE MENUITEM1 AS QMENUITEM
        CAPTION = "File"
        CREATE MENUITEM2 AS QMENUITEM
         CAPTION = "Save..."
         OnClick = SAVETEXT
        END CREATE
        CREATE MENUITEM3 AS QMENUITEM
         CAPTION = "-"
        END CREATE
        CREATE MENUITEM4 AS QMENUITEM
         CAPTION = "Quit"
         OnClick = QUITAPPLICATION
        END CREATE
       END CREATE
      END CREATE
      CREATE RichEdit1 AS QRICHEDIT
       Left = 0
       Top = 0
       Width = 556
       Height = 458
       Align = 5
       AddStrings "This is an example which shows how to save text to a file."
       PlainText = 1
      END CREATE
     END CREATE

     Form.SHOWMODAL

     SUB SAVETEXT
      IF SAVEDIALOG.EXECUTE THEN
       RichEdit1.SaveToFile SAVEDIALOG.FileName+".txt" 'That is not a good way of doing
'a file extention addon - but this is not an example
'of that ;)
       SHOWMESSAGE "Your File was successfully stored at: "+SAVEDIALOG.FileName+".txt"
      END IF
     END SUB

     SUB QUITAPPLICATION
      Application.Terminate
     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:2003-11-01 07:39:21