DirectoryListBox抓取檔案路徑問題 |
答題得分者是:Zard
|
pireer
初階會員 發表:73 回覆:80 積分:30 註冊:2004-12-14 發送簡訊給我 |
當我用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 發送簡訊給我 |
引言: 當我用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 發送簡訊給我 |
本站聲明 |
1. 本論壇為無營利行為之開放平台,所有文章都是由網友自行張貼,如牽涉到法律糾紛一切與本站無關。 2. 假如網友發表之內容涉及侵權,而損及您的利益,請立即通知版主刪除。 3. 請勿批評中華民國元首及政府或批評各政黨,是藍是綠本站無權干涉,但這裡不是政治性論壇! |