全國最多中醫師線上諮詢網站-台灣中醫網
發文 回覆 瀏覽次數:1086
推到 Plurk!
推到 Facebook!

SaveDialog的一個問題

尚未結案
Overmars
一般會員


發表:15
回覆:10
積分:5
註冊:2003-12-24

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-09-16 16:44:56 IP:61.221.xxx.xxx 未訂閱
請問當我把一堆東西存成文字檔, RichEdit->Lines->SaveToFile(SaveDialog->FileName); 但是去讀的時候發現, 被加了一些東西, 例如字型等等 {\rtf1\ansi\ansicpg950\deff0\deflang1033\deflangfe1028{\fonttbl{\f0\fnil\fcharset136 Verdana;}} \viewkind4\uc1\pard\lang1028\f0\fs18 [[General_Information]] \par XXX \par XXXX \par XXXXX \par XXXXXX \par XXXXXXX \par XXXXXXXX (XXX為原本內容) 請問如何不要把那些資訊也存進阿, 只存XXX的部分? 感謝大家! 發表人 - taishyang 於 2004/09/16 18:24:09
folkchen
高階會員


發表:9
回覆:232
積分:173
註冊:2003-10-09

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-09-16 17:00:03 IP:211.20.xxx.xxx 未訂閱
印象中RichEdit,就是可以改變內文中"部份段落"的字體或字型大小 不是全部改變 所以它有一些控制碼是正常的,就像開Word或HTML的原始檔 內容不會只有本文文字的意思一樣    你可以改用 Memo 試試  一般我是用
richtop
資深會員


發表:122
回覆:646
積分:468
註冊:2003-06-10

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-09-16 18:23:08 IP:140.129.xxx.xxx 未訂閱
Overmars 您好:    您可以先試著使用下程式碼: RichEdit1->PlainText = true;  // default: false 再存檔。
Overmars
一般會員


發表:15
回覆:10
積分:5
註冊:2003-12-24

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-09-20 11:50:16 IP:61.64.xxx.xxx 未訂閱
RichTop您好, 您的方法我試過了, 還是不行! please help!
andychang1690
資深會員


發表:20
回覆:694
積分:442
註冊:2003-03-14

發送簡訊給我
#5 引用回覆 回覆 發表時間:2004-09-20 12:56:21 IP:221.169.xxx.xxx 未訂閱
Overmars:
為何不行?
if ( SaveDialog->Execute() )
{
  // 假設存檔檔案為Text檔.
  RichEdit1->PlainText=true;
  RichEdit1->Lines->SaveToFile(SaveDialog->FileName);
}
原
{\rtf1\ansi\deff0\deflang1033{\fonttbl{\f0\fswiss Arial;}}
{\colortbl ;\red255\green0\blue0;\red0\green0\blue0;}
\viewkind4\uc1\pard\qc\cf1\b\f0\fs32 Rich Edit Control Overview
\par \cf2\fs16 (from Win32SDK Help)
\par \pard\b0\fs20 
\par \pard\fi-20\li500\ri840 A rich edit control is a window in which the user can enter and edit text. 
\par \pard\li480\ri840 
\par Rich edit controls support almost all of the messages and notification 
\par 
\par An application can send messages to a rich edit control to perform
\par You create a rich edit control by using the \ul\b CreateWindowEx\ulnone\b0  function, 
\par 
\par Rich edit controls support most of the window styles used with edit controls as well as additional styles.
\par }
變成
Rich Edit Control Overview
(from Win32SDK Help)    A rich edit control is a window in which the user can enter and edit text.     Rich edit controls support almost all of the messages and notification     An application can send messages to a rich edit control to perform
You create a rich edit control by using the CreateWindowEx function,     Rich edit controls support most of the window styles used with edit controls as well as additional styles.     請參考!    
Andy Chang
------
Andy Chang
系統時間:2024-05-06 23:11:54
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!