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

DirectoryListBox1與FileListBox1 不能互動

尚未結案
gcpp
一般會員


發表:16
回覆:19
積分:7
註冊:2004-12-29

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-01-07 00:34:08 IP:61.219.xxx.xxx 未訂閱
請問大大一下,我把project1內的Form1直接CTRL+C到project2內的Form1, 發現這DirectoryListBox1與FileListBox1就不能互動了,也就是DirectoryListBox1改變之後這 FileListBox1也沒變,Event也查了,都與原來的一樣.不知是少了那個步驟? 還是一定要從頭一個一個建?請大大指導一下
     void __fastcall TForm2::FormCreate(TObject *Sender)
{
  
 DirectoryListBox1->FileList=FileListBox1;
}    //---------------------------------------------------------------------------    void __fastcall TForm2::DirectoryListBox1Change(TObject *Sender)
{
 ListView1->Items->Clear();     for (int fCnt=0;fCntItems->Count;fCnt  ) {
      AnsiString filename=FileListBox1->Items->Strings[fCnt];
......
} 
nlj859
資深會員


發表:139
回覆:375
積分:322
註冊:2004-03-20

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-01-07 02:15:36 IP:219.80.xxx.xxx 未訂閱
Hello gcpp,    程式沒問題. 在FormCreate加上
DirectoryListBox1->FileList=FileListBox1;
即可.不行的話就重拉看看,應該蠻快的.
Zard
尊榮會員


發表:24
回覆:396
積分:539
註冊:2003-11-26

發送簡訊給我
#3 引用回覆 回覆 發表時間:2005-01-07 09:16:45 IP:210.243.xxx.xxx 未訂閱
引言: 請問大大一下,我把project1內的Form1直接CTRL C到project2內的Form1, 發現這DirectoryListBox1與FileListBox1就不能互動了,也就是DirectoryListBox1改變之後這 FileListBox1也沒變,Event也查了,都與原來的一樣.不知是少了那個步驟? 還是一定要從頭一個一個建?請大大指導一下
     void __fastcall TForm2::FormCreate(TObject *Sender)
{
  
 DirectoryListBox1->FileList=FileListBox1;
}    //---------------------------------------------------------------------------    void __fastcall TForm2::DirectoryListBox1Change(TObject *Sender)
{
 ListView1->Items->Clear();     for (int fCnt=0;fCntItems->Count;fCnt  ) {
      AnsiString filename=FileListBox1->Items->Strings[fCnt];
......
} 
是不是漏掉了設定Event呢?
void __fastcall TForm2::FormCreate(TObject *Sender)
{
 DirectoryListBox1->FileList=FileListBox1;
 DirectoryListBox1->OnChange = DirectoryListBox1Change;
}    
系統時間:2024-06-30 14:48:54
聯絡我們 | Delphi K.Top討論版
本站聲明
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。
2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。
3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇!