How to fill combBox
I created setup project in Visual Studio for my application, I changed TextBoxes (A) and put one comboBox in it, now I need to fill that comboBox with vlues (if it is possible from my installer class). To change dialog I have used Orca.exe. I have just changed type of control (TextBox to ComboBox). Bu how to add items to this ComboBox, please help me :(
0 Comments
[ + ] Show comments
Answers (4)
Please log in to answer
Posted by:
captain_planet
15 years ago
Valerij,
If I understand your question, you should have an entry for your combobox in the 'Control' table. This ComboBox should be bound to a property, and the name of this property will be specified in the 'Property' column of the 'Control' table (The property should be in your 'Property' table with a default value assigned to it). Let's suppose this property is called 'COMBOPROP'. Now, I think to add multiple values to the ComboBox you should open the 'ComboBox' table in Orca and enter your ComboBox entries similar to the following:
(Columns are Property, Order, Value and Text respectively.....)
COMBOPROP 1 itemvalue1 VisibleName1
COMBOPROP 2 itemvalue2 VisibleName2
COMBOPROP 3 itemvalue3 VisibleName3.....and so on......
If I understand your question, you should have an entry for your combobox in the 'Control' table. This ComboBox should be bound to a property, and the name of this property will be specified in the 'Property' column of the 'Control' table (The property should be in your 'Property' table with a default value assigned to it). Let's suppose this property is called 'COMBOPROP'. Now, I think to add multiple values to the ComboBox you should open the 'ComboBox' table in Orca and enter your ComboBox entries similar to the following:
(Columns are Property, Order, Value and Text respectively.....)
COMBOPROP 1 itemvalue1 VisibleName1
COMBOPROP 2 itemvalue2 VisibleName2
COMBOPROP 3 itemvalue3 VisibleName3.....and so on......
Posted by:
Valerij Zajcev
15 years ago
Posted by:
captain_planet
15 years ago
You can fill a combobox dynamically using VBscript inside a custom action type 38 (This assumes the property bound to your ComboBox control is called 'COMBOPROP'). The custom action will need to execute immediately, in the User Interface sequence (exactly where depends on where your custom dialog is situated) with a condition of 'Not Installed'.
Dim MsiDb
Dim MsiInstall
Dim MsiRecord
Dim MsiView
Dim i
'create temporary changes to database
Const ModifyAction = 7
Set MsiDb = Session.Database
Set MsiInstall = Session.Installer
Set MsiView = MsiDb.OpenView("SELECT * FROM ComboBox")
Set MsiRecord = MsiInstall.CreateRecord(4)
'this For Loop will be the dynamic values which you retrieve
'(I use this simple For Loop as an example - remember 1 is the default order if your ComboBox is ordered)
For i = 2 To 5
'Property
MsiRecord.StringData(1) = "COMBOPROP"
'Order
MsiRecord.IntegerData(2) = i
'Value
MsiRecord.StringData(3) = "my value" & i
'Text
MsiRecord.StringData(4) = "readable text " & i
Call MsiView.Execute(MsiRecord)
Call MsiView.Modify (ModifyAction, MsiRecord)
Next
Call MsiView.Close
Posted by:
anonymous_9363
15 years ago
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
so that the conversation will remain readable.