Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
CMFCPropertyGridCtrl添加可编辑字符串属性_Mfc_Propertygrid - Fatal编程技术网

CMFCPropertyGridCtrl添加可编辑字符串属性

CMFCPropertyGridCtrl添加可编辑字符串属性,mfc,propertygrid,Mfc,Propertygrid,我从CMFCPropertyGridCtrl派生了一个类,为我的需要添加了一个简单的接口。我想添加一个新的字符串值,以便编辑它: void CPropertyGrid::AddString(常量字符*标记,常量字符*默认值) { COleVariant valueType(默认值); CMFCPropertyGridProperty*stringProperty=新的CMFCPropertyGridProperty(标记,值类型); stringProperty->AllowEdit(TRUE)

我从CMFCPropertyGridCtrl派生了一个类,为我的需要添加了一个简单的接口。我想添加一个新的字符串值,以便编辑它:

void CPropertyGrid::AddString(常量字符*标记,常量字符*默认值)
{
COleVariant valueType(默认值);
CMFCPropertyGridProperty*stringProperty=新的CMFCPropertyGridProperty(标记,值类型);
stringProperty->AllowEdit(TRUE);
AddProperty(stringProperty);
}

这会在属性网格中添加一个新字符串,但我无法编辑它。是否有其他方法使此可编辑


谢谢

必须将Notify value设置为true才能编辑值

我不知道问题是无法从网格中选择编辑控件,还是该值为只读且无法修改!这是什么意思?我已查找“Notify”标志,但在任何地方都找不到。@Joe:当您在资源编辑器中编辑放置
CMFCPropertyGridCtrl
的窗口时,单击
CMFCPropertyGridCtrl
,然后在属性窗口中查找,您应该会看到Notify true或false选项。
void CPropertyGrid::AddString(const char* tag, const char* defaultValue)
{
    COleVariant valueType(defaultValue);
    CMFCPropertyGridProperty *stringProperty = new CMFCPropertyGridProperty(tag, valueType);
    stringProperty->AllowEdit(TRUE);
    AddProperty(stringProperty);
}