Select to view content in your preferred language

ListBoxes, RadioButtons, Checkboxes in ParameterInfo

764
2
03-20-2012 07:44 AM
MarilynGambone
Deactivated User
How do I specify a listbox, radiobutton, or checkbox in ParameterInfo?  I can't really use IGPCodedValueDomain in lieu of listbox because there are hundreds of items.

Thanks for any help.
0 Kudos
2 Replies
MarilynGambone
Deactivated User
Okay, then... if it's not possible to use a listbox to display features of a shapefile, is it possible to show a windows form instead of the ParameterInfo window when user clicks a custom tool in ArcToolBox?
0 Kudos
MarilynGambone
Deactivated User
Hi,

I was able to list a shapefile's attribute table using a combobox in a custom tool IGPFunction2 implementation by using the following snippet inside the ParameterInfo property. I wanted a checklist or listbox but can't find how to do it.

IArray parameters = new ArrayClass();

//Parameter 1: field_param (List fields in combobox)
IGPParameterEdit3 field_param = new GPParameterClass();
field_param.Name = "field_param";
field_param.DisplayName = "Select Field (with unique values)";
field_param.DataType = new FieldTypeClass() as IGPDataType;
field_param.Value = new FieldClass() as IGPValue;
field_param.AddDependency("input_features"); //input_features DataType should be GPFeatureLayerTypeClass()
field_param.Direction = esriGPParameterDirection.esriGPParameterDirectionInput;
field_param.ParameteryType = esriGPParameterType.esriGPParameterTypeRequired;
parameters.Add(field_param);

When the tool is double-clicked in ArcToolBox, the field_param lists all fields of the input_features (shapefile or feature class).  Note the AddDependency property.  The fields change depending on the input_features.

Anyone knows how to convert the above into checkboxes (instead of combobox)?
0 Kudos