2017년 3월 20일 월요일

[Development story] GFtp #5 - To add explorer using open source.

GFtp is became more pretty than before. But It needs become more pretty and more easy.
Specially, moving between directories is pretty uncomfortable. So I decided to get open source like explorer tree control for that. My favorite site for open source is CodeProject.
CodeProject has so many open source and good article. To beginner like me, that is that best place.
I found a good control. Follow is link of that.

https://www.codeproject.com/Articles/14570/A-Windows-Explorer-in-a-user-control

First of all, I thanks to Raj Lal who made this control.

1. Update list

 - Added explorer Tree using open source.
 - Relayouts all controls.

2. GFtp v1.3 demo


3. To add explorer Tree 

  To add this control, C# needs only .dll file.
  C++ needs .h and .dll files.
  I am satisfied with C# useful.
  At first, you have to add user control(.dll) so you can use a user control on the form.
  Following is how to add user control(.dll).
   - Right click on the All Windows Forms of the Toolbox.
   - Click menu Choose Items...
   - Select .dll file after Browse button click.
   - Select user control.
   - Click OK button.
   - Done.
   
 To use user control, just drag&drop from the Toolbox to your Form.
 If you feel difficult to find ExplorerTree in the Toolbox, search Toolbox.

 User control what I added is shaped like following.


  I added it on the GFtp like that.




   Following code is to apply ExplorerTree(usercontrol) to GFtp.
   If you double click the ExplorerTree(user control), PathChanged event method is made automatically.

        // Called when changed path on explorerTree
        private void explorerTree_PathChanged(object sender, EventArgs e)
        {
            CurrentDirectory = explorerTree.SelectedPath;
            RefreshFileGridViewOfCurrentDirectory();
        }

  I just call explorerTree.SelectedPath method and set string to CurrentDirectory property.
  And done with calling RefreshFileGridViewOfCurrentDirectory().

4. Next

 I can't test upload yet cause I can't find Ftp server to upload.
 So I will make Ftp server to upload test.


This source is shared.
GitHub : https://github.com/gurum77/GFtp

  









댓글 없음:

댓글 쓰기