managed c++ 中使用 propertygrid

using namespace System;
using namespace System::Windows::Forms;
using namespace System::ComponentModel;

public ref class mgClass
{
public:
 mgClass();       
protected:
 !mgClass();    
public:
 ~mgClass();
 [Description("This is the new top1m file")]//FileNameEditor
 [Category("Global")]
 //[EditorAttribute(EditorBaseTypeName="System.Drawing.Design.UITypeEditor, System.Drawing, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", EditorTypeName="Dundas.Charting.WebControl.Design.LegendItemCollectionEditor, DundasRSChart, Version=3.1.0.254, Culture=neutral, PublicKeyToken=11fb0f2e372fc326")]
 [Editor((System::Windows::Forms::Design::FolderNameEditor::typeid), ( System::Drawing::Design::UITypeEditor::typeid))]
 //[Editor(typeof(FileSelectorTypeEditor), typeof(UITypeEditor))]
 property String^ FirstName
 {
  String ^ get ();
  void set (String ^str);
 }
 property String^ LastName
 {
  String ^ get ();
  void set (String ^str);
 }
 String^ JoinName();
private:
 //PureCClass* m_pImpObj;
};


注意,如果要属性可以打开文件或者文件夹选择框,需要引用 System.Design.dll  然后在属性上面添加[Editor((System::Windows::Forms::Design::FolderNameEditor::typeid), ( System::Drawing::Design::UITypeEditor::typeid))]

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值