我已经添加了组合框到我的用户界面。如何从自定义动作填充WIX组合框
<Control Id ="ExistingPortCombo" Type="ComboBox" X="120" Y="120" Width="200" Height="50" Property="ComboSelectedPort" ComboList="yes" >
<ComboBox Property="ComboSelectedPort" />
</Control>
我希望它从自定义操作中填充。我尽可能做到这一点。
这里是我的功能来填充列表
static int index = 0;
private static void AddRecordToList(string propertyName,string text,string value,string control)
{
try
{
View view = CurrentSession.Database.OpenView("SELECT * FROM " + control);
view.Execute();
Record record = CurrentSession.Database.CreateRecord(4);
record.SetString(1, propertyName);
record.SetInteger(2, ++index);
record.SetString(3, text);
record.SetString(4, value);
view.Modify(ViewModifyMode.InsertTemporary, record);
view.Close();
}
catch (Exception ex)
{
global::System.Windows.Forms.MessageBox.Show(ex.Message);
}
}
然后我打电话:
AddRecordToComboBox("ComboSelectedPort", text, value,"ComboBox");
此方法适用于列表框,但但对于组合框给出错误。
任何人都可以看到我在这里做错了吗?