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

HeaderControl要怎麼找出要draw的Section

尚未結案
fantasy
一般會員


發表:10
回覆:9
積分:3
註冊:2003-11-27

發送簡訊給我
#1 引用回覆 回覆 發表時間:2003-12-13 00:50:33 IP:218.170.xxx.xxx 未訂閱
各位高手,小妹有些secton問題,想要在上想出現圖 卻每一個section都跑出來,想問一下有沒有方法能方便判斷出 section出來     我寫了如下,但是每次都全部出現,有夠討厭的 \/    
void __fastcall TForm1::draw(TRect &x){
    Graphics::TPicture *tp;        tp=new TPicture;
    tp->LoadFromFile("C:\\ICONS\\vaio\\io_073.ico");
    HeaderControl1->Canvas->Draw(x.left,x.top,tp->Icon);
 }     void __fastcall TForm1::HeaderControl1DrawSection(
      THeaderControl *HeaderControl, THeaderSection *Section,
      const TRect &Rect, bool Pressed)
   {
    ShowMessage(HeaderControl1->Sections->Count);
     int icount=HeaderControl1->Sections->Count;       for(int i=0;iSections->Items[i]->Text);
      if(HeaderControl1->Sections->Items[i]->Text=='0'){
      draw(Rect);
      break;
      }
   }
} 
RaynorPao
版主


發表:139
回覆:3622
積分:7025
註冊:2002-08-12

發送簡訊給我
#2 引用回覆 回覆 發表時間:2003-12-13 01:49:56 IP:61.221.xxx.xxx 未訂閱
引言: 各位高手,小妹有些secton問題,想要在上想出現圖 卻每一個section都跑出來,想問一下有沒有方法能方便判斷出 section出來 我寫了如下,但是每次都全部出現,有夠討厭的 \/
void __fastcall TForm1::draw(TRect &x){
    Graphics::TPicture *tp;        tp=new TPicture;
    tp->LoadFromFile("C:\\ICONS\\vaio\\io_073.ico");
    HeaderControl1->Canvas->Draw(x.left,x.top,tp->Icon);
 }     void __fastcall TForm1::HeaderControl1DrawSection(
      THeaderControl *HeaderControl, THeaderSection *Section,
      const TRect &Rect, bool Pressed)
   {
    ShowMessage(HeaderControl1->Sections->Count);
     int icount=HeaderControl1->Sections->Count;       for(int i=0;iSections->Items[i]->Text);
      if(HeaderControl1->Sections->Items[i]->Text=='0'){
      draw(Rect);
      break;
      }
   }
} 
fantasy 你好: 試試看這樣子寫行不行呢?? < class="code"> Graphics::TPicture *tp=NULL; __fastcall TForm1::TForm1(TComponent* Owner) : TForm(Owner) { tp=new TPicture; tp->LoadFromFile("C:\\test.ico"); } __fastcall TForm1::~TForm1() { delete tp; } void __fastcall TForm1::HeaderControl1DrawSection( THeaderControl *HeaderControl, THeaderSection *Section, const TRect &Rect, bool Pressed) { if(Section->Text=="0") { HeaderControl->Canvas->Draw(Rect.Left, Rect.Top, tp->Icon); } } -- Enjoy Researching & Developing --
------
-- 若您已經得到滿意的答覆,請適時結案!! --
-- 欲知前世因,今生受者是;欲知來世果,今生做者是 --
-- 一切有為法,如夢幻泡影,如露亦如電,應作如是觀 --
fantasy
一般會員


發表:10
回覆:9
積分:3
註冊:2003-11-27

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