|
Автор:
|
|
|
Название:
|
Как организовать Folder Browser |
|
Дата:
|
21 October 2002 |
|
Описание: |
Стандартный диалог оказывается сидит в System.Design.DLL |
| |
Разместить ссылку на этот исходник в форуме вы можете вставив в текст сообщения
следующую строку:
[CODEPOST ID=19]Как организовать Folder Browser[/CODEPOST] |
| Оценка: |
Проголосовало 4 посетителей, средняя оценка 4.00 |
| Оценить: |
|
1 // add a reference to System.Design.DLL
2
3 using System;
4 using System.Windows.Forms;
5 using System.Windows.Forms.Design;
6 using System.Windows.Forms.ComponentModel;
7
8
9 public class DirBrowser : FolderNameEditor
10
11 {
12
13 FolderBrowser fb = new FolderBrowser();
14
15
16
17 public string Description
18
19 {
20
21 set { _description = value; }
22
23 get { return _description; }
24
25 }
26
27
28
29 public string ReturnPath
30
31 {
32
33 get { return _returnPath; }
34
35 }
36
37
38
39 public DirBrowser() { }
40
41
42
43 public DialogResult ShowDialog()
44
45 {
46
47 fb.Description = _description;
48
49 fb.StartLocation = FolderBrowserFolder.MyComputer;
50
51
52
53 DialogResult r = fb.ShowDialog();
54
55 if (r == DialogResult.OK)
56
57 _returnPath = fb.DirectoryPath;
58
59 else
60
61 _returnPath = String.Empty;
62
63
64
65 return r;
66
67 }
68
69
70
71 private string _description = "Choose Directory";
72
73 private string _returnPath = String.Empty;
74
75 }
76 |
| Вернуться к списку исходников в категории Winforms |