如何开发一个选择路径的控件(100分)

  • 主题发起人 主题发起人 牛龙
  • 开始时间 开始时间

牛龙

Unregistered / Unconfirmed
GUEST, unregistred user!
大家知道,32位windows 中fileopen对话框可以从本机或局域网内选择文件,我想开发一个控件,从本机和局域网内选择路径。虽然delphi中有相应的控件但是不能从局域网内选择。不知哪位大侠有这方面的经验给我指教指教!!!
 
How to Connect to a Network
Drive in Delphi

This document explains how to create a 'Network' button that
brings up a connection dialog and then sets a drive box to point
to the new drive in Delphi. The code was created in Delphi 2,
but doing it in Delphi 1 should be about the same procedure.

Create a command button named NetBtn, and a drive combo box
named DriveBox. Then type this code in the OnClick event for the
button:



procedure TStartForm.NetBtnClick(Sender: TObject);
var
OldDrives: TStringList;
i: Integer;
begin
OldDrives := TStringList.Create;
OldDrives.Assign(Drivebox.Items); // Remember old drive list
// Show the connection dialog
if WNetConnectionDialog(Handle, RESOURCETYPE_DISK) = NO_ERROR then begin
DriveBox.TextCase := tcLowerCase; // Refresh the drive list box
for i := 0 to DriveBox.Items.Count - 1 do begin
if Olddrives.IndexOf(Drivebox.Items) = -1 then begin // Find new Drive letter
DriveBox.ItemIndex := i; // Updates the drive list box to new drive letter
DriveBox.Drive := DriveBox.Text[1]; // Cascades the update to connected directory lists, etc
end;
end;
DriveBox.SetFocus;
end;
OldDrives.Free;
end;
 
老牛啊!这个问题你好像问过一次了,
你的上一个问题中我和yysun建议的用treeview的
控件都不行吗?一定要用comboBox? :)
 
忘记说地址了:
http://www.pobox.com/~bstowers/delphi/mine/files/browsedr.zip

本论坛的控件库里也应该有,只是不知道是否最新。
 
Rxlib里有
 
太好了,谢谢诸位.
 

Similar threads

D
回复
0
查看
919
DelphiTeacher的专栏
D
D
回复
0
查看
709
DelphiTeacher的专栏
D
D
回复
0
查看
671
DelphiTeacher的专栏
D
D
回复
0
查看
2K
DelphiTeacher的专栏
D
后退
顶部