我有很多遗留代码,我正在尝试修改很少的行,以便获得所需的功能。我的问题是:
我有一个DevExpress.XtraEditors.ListBoxControl。现在有一个'initFunction'在运行时填充此ListBoxControl。 initFunction()最初是这样的:
initFunction()
{
//code to populate and initialize ListBoxControl
abc = new DevExpress.XtraEditors.ListBoxControl(); //abc is declared as ListBoxControl
}//end of initFunction
我必须修改该功能,使它看起来像这样:
initFunction(bool allowMultipleSelect)
{
if(allowMultipleSelect)
{
//initialize the ListBoxControl as a CheckedListBoxControl
}
if(!allowMultipleSelect)
{
/*initialize the ListBoxControl as Radio Group Control so that only one value can be selected from the list */
}
}//end of initFunction
现在,我该如何继续这样做?我尝试在ListBoxControl中查找属性,这将允许我有选择地将控件初始化为已检查/无线电控件,但找不到任何属性。
也无法将ListBoxControl初始化为CheckedListBoxControl / Radio Control。那么有什么建议吗?