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

DirectoryListBox抓取檔案路徑問題

答題得分者是:Zard
pireer
初階會員


發表:73
回覆:80
積分:30
註冊:2004-12-14

發送簡訊給我
#1 引用回覆 回覆 發表時間:2005-01-10 12:18:33 IP:61.220.xxx.xxx 未訂閱
當我用DirectoryListBox抓取到檔案路徑時. 長度小於30 "C:\\Documents and Settings" 長度大於30.就會將前面的目錄改成 "C:\\...\\Administrator\\桌面" void __fastcall TFormSelectDIFile::Edit1Change(TObject *Sender) { AnsiString FileName; FileName = Label6->Caption "\\" Edit1->Text; Label7->Caption = FileName; } 設定 DriveComboBox1->DirList = DirectoryListBox1; DirectoryListBox1->FoleList = FileListBox1; DirectoryListBox1->DirLabel = Label6; FileListBox1->FileEdit = Edit1; 請問怎樣抓到長度大於30的完整路徑?
Zard
尊榮會員


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

發送簡訊給我
#2 引用回覆 回覆 發表時間:2005-01-10 12:51:45 IP:210.243.xxx.xxx 未訂閱
引言: 當我用DirectoryListBox抓取到檔案路徑時. 長度小於30 "C:\\Documents and Settings" 長度大於30.就會將前面的目錄改成 "C:\\...\\Administrator\\桌面" void __fastcall TFormSelectDIFile::Edit1Change(TObject *Sender) { AnsiString FileName; FileName = Label6->Caption "\\" Edit1->Text; Label7->Caption = FileName; } 設定 DriveComboBox1->DirList = DirectoryListBox1; DirectoryListBox1->FoleList = FileListBox1; DirectoryListBox1->DirLabel = Label6; FileListBox1->FileEdit = Edit1; 請問怎樣抓到長度大於30的完整路徑?
拿掉這行 DirectoryListBox1->DirLabel = Label6;, 並實作DirectoryListBox1的OnChange事件, 如下所示.
...
...
DriveComboBox1->DirList = DirectoryListBox1;
DirectoryListBox1->FoleList = FileListBox1;
//DirectoryListBox1->DirLabel = Label6;
FileListBox1->FileEdit = Edit1;
...
...    void __fastcall TForm1::DirectoryListBox1Change(TObject *Sender)
{
  Label1->Caption = DirectoryListBox1->Directory;
}    
pireer
初階會員


發表:73
回覆:80
積分:30
註冊:2004-12-14

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