/build/static/layout/Breadcrumb_cap_w.png

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)

Posted by: captain_planet 15 years ago
Black Belt
0
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......
Posted by: Valerij Zajcev 15 years ago
Yellow Belt
0
But, I don't know with what items program should fill combo box. Every network has its own SQL server names. I have a VB script file to do this, and I have method in c# that do this, but I don't know how to put that values dynamically in combo box.
Posted by: captain_planet 15 years ago
Black Belt
0
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
Red Belt
0
If your package is for external rather than internal consumption, you need to consider how it would handle silent installs.
Rating comments in this legacy AppDeploy message board thread won't reorder them,
so that the conversation will remain readable.
 
This website uses cookies. By continuing to use this site and/or clicking the "Accept" button you are providing consent Quest Software and its affiliates do NOT sell the Personal Data you provide to us either when you register on our websites or when you do business with us. For more information about our Privacy Policy and our data protection efforts, please visit GDPR-HQ