ComboBox Drop Down Width

789
2
Jump to solution
12-05-2013 05:05 AM
Highlighted
New Contributor III
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
Reply
0 Kudos
1 Solution

Accepted Solutions
Highlighted
New Contributor III
"Size String" is as you say the width of the actual combobox on the toolbar
"Item Size String" is the width of it's drop down

View solution in original post

Reply
0 Kudos
2 Replies
Highlighted
New Contributor III
"Size String" is as you say the width of the actual combobox on the toolbar
"Item Size String" is the width of it's drop down

View solution in original post

Reply
0 Kudos
Highlighted
New Contributor III
"Size String" is as you say the width of the actual combobox on the toolbar
"Item Size String" is the width of it's drop down


Gosh, so simple! Thank you!
Reply
0 Kudos