我已經添加了組合框到我的用戶界面。如何從自定義動作填充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");
此方法適用於列表框,但但對於組合框給出錯誤。
任何人都可以看到我在這裏做錯了嗎?