FolderBrowserDialog를 확장하여 선택한 폴더의 하위 폴더를 포함 할 수있는 옵션을 포함하고자합니다 (포함 여부를 선택하는 확인란 추가). 봉인 된 클래스이므로 기본 FolderBrowserDialog를 확장 할 수 없다는 것을 알았습니다.CommonDialog 클래스에서 파생 된 사용자 정의 사용자 정의 컨트롤을 만드는 방법
그래서 가장 간단한 해결책은 CommonBialserDialog과 동일한 클래스 인 CommonDialog에서 파생 된 사용자 정의 컨트롤을 만드는 것이고 표준 FolderBrowserDialog에서 코드를 복사 한 다음 조금만 변경하여 사용자 정의 컨트롤을 만들 것이라고 생각했습니다. "하위 폴더 포함"확인란.
missing partial modifier on declaration of type [my_class_name] another partial declaration of this type exists c#
그리고는 "[my_class_name] .Designer.cs"파일에 지적 : 내가 기본에서 코드를 복사 할 때
는하지만 나에게 오류를 제공 FolderBrowserDialog.
namespace my_custom_folder_open
{
// Summary:
// Prompts the user to select a folder. This class cannot be inherited.
[DefaultEvent("HelpRequest")]
[DefaultProperty("SelectedPath")]
[Designer("System.Windows.Forms.Design.FolderBrowserDialogDesigner, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a")]
public sealed class UserControl2 : CommonDialog
{
// Summary:
// Initializes a new instance of the System.Windows.Forms.FolderBrowserDialog
// class.
public UserControl2();
// Summary:
// Gets or sets the descriptive text displayed above the tree view control in
// the dialog box.
//
// Returns:
// The description to display. The default is an empty string ("").
[Browsable(true)]
[DefaultValue("")]
[Localizable(true)]
public string Description { get; set; }
//
// Summary:
// Gets or sets the root folder where the browsing starts from.
//
// Returns:
// One of the System.Environment.SpecialFolder values. The default is Desktop.
//
// Exceptions:
// System.ComponentModel.InvalidEnumArgumentException:
// The value assigned is not one of the System.Environment.SpecialFolder values.
[Browsable(true)]
[Localizable(false)]
public Environment.SpecialFolder RootFolder { get; set; }
//
// Summary:
// Gets or sets the path selected by the user.
//
// Returns:
// The path of the folder first selected in the dialog box or the last folder
// selected by the user. The default is an empty string ("").
[Browsable(true)]
[DefaultValue("")]
[Localizable(true)]
public string SelectedPath { get; set; }
//
// Summary:
// Gets or sets a value indicating whether the New Folder button appears in
// the folder browser dialog box.
//
// Returns:
// true if the New Folder button is shown in the dialog box; otherwise, false.
// The default is true.
[Browsable(true)]
[DefaultValue(true)]
[Localizable(false)]
public bool ShowNewFolderButton { get; set; }
// Summary:
// Occurs when the user clicks the Help button on the dialog box.
[Browsable(false)]
[EditorBrowsable(EditorBrowsableState.Never)]
public event EventHandler HelpRequest;
// Summary:
// Resets properties to their default values.
public override void Reset();
protected override bool RunDialog(IntPtr hWndOwner);
}
}
어디에서 문제가 될 수 있습니까?
는 Btw은 내가 당신이 가진 잘못된 궤도에 심각 있습니다 윈도우 컨트롤 라이브러리 양식으로 프로젝트 ..
제목을 편집했습니다. "[제목에"태그 "가 포함되어 있어야합니까?] (http://meta.stackexchange.com/questions/19190/)"합의가 "아니오, 그렇지 않아야한다"는 것을 참조하십시오. –