Loading... You can accomplish this without using a TOpenDialog component. First, add FileCtrl to the Uses. Now the <a href="https://www.samool.com/go/aHR0cDovL2RlbHBoaS5hYm91dC5jb20vbGlicmFyeS9ydGwvYmxydGxTZWxlY3REaXJlY3RvcnkuaHRt" target="_blank" ><font color="#236eb5">SelectDirectory</font></a> function can be used. Drop a TButton component on your Form. Place the following code in the button's onClick event to get a demonstration of how this function works:<p>~~~~~~~~~~~~~~~~~~~~~~~~~<br />procedure TForm1.Button1Click(Sender: TObject) ;<br />const<br /> SELDIRHELP = 1000;<br />var<br /> dir: String;<br />begin<br /> dir := 'C:';<br /> if SelectDirectory(<br /> dir,<br /> [sdAllowCreate,<br /> sdPerformCreate,<br /> sdPrompt],<br /> SELDIRHELP<br /> ) then<br /> Button1.Caption := dir;<br />end;<br />~~~~~~~~~~~~~~~~~~~~~~~~~<br /></p> 相关文章 无相关文章 Last modification:August 16th, 2009 at 12:30 pm © 允许规范转载 Support 如果觉得我的文章对你有用,请随意赞赏 ×Close Appreciate the author Sweeping payments Pay by AliPay Pay by WeChat