AnsweredAssumed Answered

ComboBox Drop Down Width

Question asked by davecouture on Dec 5, 2013
Latest reply on Dec 5, 2013 by davecouture
I've built a VB.NET Toolbar AddIn for ArcMap that uses a ComboBox selection to add a new Layer in the ActiveView.  My problem is, I can't seem to find a way to increase the width of the drop-down menu.   I've tried using the sizeString="WWWWWWWWW" in the Config.esriaddinx file, but that only increased the ComboBox width, and not the drop-down width. No matter how long the selection string is, the drop-down width only shows the first 9 characters. Anyone knows how I can do this?


Here's my code:

Imports ESRI.ArcGIS.Geodatabase Imports ESRI.ArcGIS.Carto Imports ESRI.ArcGIS.Display Imports ESRI.ArcGIS.Geometry Imports ESRI.ArcGIS.esriSystem Imports System.Windows.Forms Imports ESRI.ArcGIS.ArcMapUI   Public Class AddData     Inherits ESRI.ArcGIS.Desktop.AddIns.ComboBox      Public Sub New()         Dim layerName As String() = {"Basemap", "Civic", "Parcels", "Zoning", "Water & Sewer", "Ortho 2012", "Ortho 2010"}         For Each item As String In layerName             Add(item)         Next     End Sub       Protected Overloads Overrides Sub OnSelChange(ByVal selection As Integer)          Dim pMap As IMap = My.ArcMap.Document.ActiveView         Dim lyr As ILayerFile = New LayerFile()          Select Case Value             Case "Basemap"                 If True Then                     lyr.Open("G:\Data\Layers\Basemap (SDE).lyr")                     Dim pLayer As ILayer = lyr.Layer                     pMap.AddLayer(pLayer)                     Exit Select                 End If             Case "Civic"                 If True Then                     lyr.Open("G:\Data\Layers\Civic_Addresses.lyr")                     Dim pLayer As ILayer = lyr.Layer                     pMap.AddLayer(pLayer)                     Exit Select                 End If             Case "Parcels"                 If True Then                     lyr.Open("G:\Data\Layers\Property & Zoning (SDE).lyr")                     Dim pLayer As ILayer = lyr.Layer                     pMap.AddLayer(pLayer)                     Exit Select                 End If             Case "Zoning"                 If True Then                     lyr.Open("G:\Data\Layers\Zoning (SDE).lyr")                     Dim pLayer As ILayer = lyr.Layer                     pMap.AddLayer(pLayer)                     Exit Select                 End If             Case "Water & Sewer"                 If True Then                     lyr.Open("G:\Data\Layers\Water And Sewer.lyr")                     Dim pLayer As ILayer = lyr.Layer                     pMap.AddLayer(pLayer)                     Exit Select                 End If             Case "Ortho 2012"                 If True Then                     lyr.Open("G:\Data\Layers\2012 Ortho.lyr")                     Dim pLayer As ILayer = lyr.Layer                     pMap.AddLayer(pLayer)                     Exit Select                 End If             Case "Ortho 2010"                 If True Then                     lyr.Open("G:\Data\Layers\2012 Ortho.lyr")                     Dim pLayer As ILayer = lyr.Layer                     pMap.AddLayer(pLayer)                     Exit Select                 End If         End Select          MyBase.OnSelChange(selection)      End Sub End Class

Outcomes