線上訂房服務-台灣趴趴狗聯合訂房中心
發文 回覆 瀏覽次數:1586
推到 Plurk!
推到 Facebook!

TFont

答題得分者是:dllee
jason_cyl329
高階會員


發表:123
回覆:155
積分:105
註冊:2003-05-26

發送簡訊給我
#1 引用回覆 回覆 發表時間:2004-03-19 12:47:23 IP:211.23.xxx.xxx 未訂閱
請問,TFont的style要如何一個一個設定 好像只能夠集體設定 Font->Style = TFontStyles()<< fsBold << fsUnderline; 如果我用變數TypeReg將style特性存起來, EX if ((TypeReg&BOLD) ) Font->Style << fsBold; if ((TypeReg&ITALIC) ) Font->Style << fsItalic; if ((TypeReg&UNDERLINE)) Font->Style << fsUnderline; if ((TypeReg&STRIKEOUT) ) Font->Style << fsStrikeOut; 這樣好像無效,或者要用什麼方法來儲存?
kwu
中階會員


發表:10
回覆:57
積分:58
註冊:2003-10-31

發送簡訊給我
#2 引用回覆 回覆 發表時間:2004-03-19 13:08:26 IP:61.63.xxx.xxx 未訂閱
引言: 請問,TFont的style要如何一個一個設定 好像只能夠集體設定 Font->Style = TFontStyles()<< fsBold << fsUnderline; 如果我用變數TypeReg將style特性存起來, EX if ((TypeReg&BOLD) ) Font->Style << fsBold; if ((TypeReg&ITALIC) ) Font->Style << fsItalic; if ((TypeReg&UNDERLINE)) Font->Style << fsUnderline; if ((TypeReg&STRIKEOUT) ) Font->Style << fsStrikeOut; 這樣好像無效,或者要用什麼方法來儲存?
jason_cyl329你好: 請參考看看 TFontStyles fs1,fs2; fs1 << fsBold; fs2 << fsItalic; Font1->Style = fs1; Font2->Style = fs2; 發表人 - kwu 於 2004/03/19 13:12:34
dllee
站務副站長


發表:321
回覆:2519
積分:1711
註冊:2002-04-15

發送簡訊給我
#3 引用回覆 回覆 發表時間:2004-03-19 13:11:42 IP:220.139.xxx.xxx 未訂閱
引言: 請問,TFont的style要如何一個一個設定 好像只能夠集體設定 Font->Style = TFontStyles()<< fsBold << fsUnderline; 如果我用變數TypeReg將style特性存起來, EX
    if ((TypeReg&BOLD) )
     Font->Style << fsBold;
    if ((TypeReg&ITALIC) )
     Font->Style << fsItalic;
    if ((TypeReg&UNDERLINE))
     Font->Style << fsUnderline;
    if ((TypeReg&STRIKEOUT) )
     Font->Style << fsStrikeOut;
這樣好像無效,或者要用什麼方法來儲存?
試試
    Font->Style.Clear();  // 先清空屬性
    if ((TypeReg&BOLD) )
       Font->Style = Font->Style << fsBold;
    if ((TypeReg&ITALIC) )
       Font->Style = Font->Style << fsItalic;
    if ((TypeReg&UNDERLINE))
       Font->Style = Font->Style << fsUnderline;
    if ((TypeReg&STRIKEOUT) )
       Font->Style = Font->Style << fsStrikeOut;
因為單獨的
Font->Style << fsBold
只是一個運算,必需
Font->Style = Font->Style << fsBold;
才能將運算結果儲存。 沒空更新的網頁... http://dllee.ktop.com.tw C及指標教學,計算機概論,資訊管理導論... http://dllee.adsldns.org 介紹Shells,LiteStep,GeoShell....
------
http://www.ViewMove.com
jason_cyl329
高階會員


發表:123
回覆:155
積分:105
註冊:2003-05-26

發送簡訊給我
#4 引用回覆 回覆 發表時間:2004-03-19 13:47:09 IP:211.23.xxx.xxx 未訂閱
dllee 感恩!!
系統時間:2024-05-19 6:04:50
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!