本程序用 MFC 实现 属性列表框(Property Listbox), 就象 VB 的 IDE 环境一样.用户可以在Property Listbox中包含 edit box, a combo box, an RBG color value, a font name, or a file name
CPropertyItem(CString propName, CString curValue, int nItemType, CString cmbItems)
参数说明:
int AddPropItem(CPropertyItem* pItem);
The following lines add a property of each type to a CPropertyList box (m_propList).
//Add an edit box for a property called 'ToolTip Text' CPropertyItem* propItem1 = new CPropertyItem("ToolTip Text","",PIT_EDIT,""); m_propList.AddPropItem(propItem1); //Add a combo box with the choices 'true' and 'false' //for a property called 'Enabled' CPropertyItem* propItem2 = new CPropertyItem("Enabled","true",PIT_COMBO,"true|false|"); m_propList.AddPropItem(propItem2); //Add a color chooser for a property called 'Back. Color' CPropertyItem* propItem3 = new CPropertyItem("Back. Color","",PIT_COLOR,""); m_propList.AddPropItem(propItem3); //Add a file chooser for a property called 'File Name' CPropertyItem* propItem4 = new CPropertyItem("File Name","",PIT_FILE,""); m_propList.AddPropItem(propItem4); //Add a font chooser for a property called 'Font' CPropertyItem* propItem5 = new CPropertyItem("Font","",PIT_FONT,""); m_propList.AddPropItem(propItem5);