TFrame 上擺放的 TRichEdit(或 TntRichEdit) 無法顯示內容 |
答題得分者是:daldal
|
linly
一般會員 發表:42 回覆:37 積分:15 註冊:2007-10-07 發送簡訊給我 |
您好:
小弟做了一個實驗,先在 TFrame 上擺放一個 TRichEdit (或 TntRichEdit),並且把 TRichEdit(或 TntRichEdit) 的 Align 設定為 clClient 填滿整塊區域,接著使用一個 Form,這個 Form 的上半部先擺一個 TRichEdit(或 TntRichEdit),下半部擺我剛剛的那個 Frame,接著在建構子執行以下兩句: [code cpp] this->RichEdit->Lines->LoadFromFile("測試.txt"); this->MyFrame->RichEdit->Lines->LoadFromFile("測試.txt"); [/code] 會發生 Frame 上的那一個 RichEdit 沒有內容 (全白),而 Form 上面的 RichEdit 則正常顯示。請問一下有板友們也發生這種問題嗎?為什麼會這樣?還請指點迷津,謝謝 ^__^ PS: 那個 "測試.txt" 編碼為 Ansi(Big5),裡頭有中文 英文 |
daldal
高階會員 發表:6 回覆:102 積分:226 註冊:2007-06-18 發送簡訊給我 |
|
linly
一般會員 發表:42 回覆:37 積分:15 註冊:2007-10-07 發送簡訊給我 |
我發現問題在哪裡了。導致 Frame 上面的 RichEdit 會沒內容,而 From 上面的 RichEdit 元件內容正常顯示,是因為前者我殘留一行 code:
[code cpp] this->MyFrame->RichEdit->DoubleBuffered = true; [/code] 這導致了內容無法顯示出來的問題,有人知道這是為什麼嗎? PS:會說是殘留,是因為我原本 Frame 上的元件是 TntMemo,為了拉捲軸時不讓其上的內容閃爍,所以加上去的,後來測試 RichEdit 沒有拿掉。 |
daldal
高階會員 發表:6 回覆:102 積分:226 註冊:2007-06-18 發送簡訊給我 |
Description When DoubleBuffered is false, the windowed control paints itself directly to the window. When DoubleBuffered is true, the windowed control paints itself to an in-memory bitmap that is then used to paint the window. Double buffering reduces the amount of flicker when the control repaints, but is more memory intensive. When a windowed control is a dock site and has an associated dock manager, it must be double-buffered. Note: Some controls, such as TRichEdit, can't paint themselves into a bitmap. For such controls, DoubleBuffered must be set to false. |
linly
一般會員 發表:42 回覆:37 積分:15 註冊:2007-10-07 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |