Back to Devexpress

MapSearchPanelOptions.Width Property

windowsforms-devexpress-dot-xtramap-dot-mapsearchpaneloptions-f9839457.md

latest4.2 KB
Original Source

MapSearchPanelOptions.Width Property

Gets or sets the search panel width in DIPs (device-independent pixels).

Namespace : DevExpress.XtraMap

Assembly : DevExpress.XtraMap.v25.2.dll

NuGet Package : DevExpress.Win.Map

Declaration

csharp
[DefaultValue(180)]
public int Width { get; set; }
vb
<DefaultValue(180)>
Public Property Width As Integer

Property Value

TypeDefaultDescription
Int32180

A value that defines the search panel width.

|

Property Paths

You can access this nested property as listed below:

Object TypePath to Width
MapControl

.SearchPanelOptions .Width

|

Remarks

The map control measures the search panel width as follows:

Example

The following example configures the search panel options such as width, prompt message, and so on:

csharp
using DevExpress.XtraMap;

    private void OnFormLoad(object sender, EventArgs e) {
        // Enable search:
        InformationLayer infoLayer = new InformationLayer();
        mapControl1.Layers.Add(infoLayer);
        BingSearchDataProvider searchProvider = new BingSearchDataProvider();
        infoLayer.DataProvider = searchProvider;
        searchProvider.BingKey = bingKey;

        // Specify search panel options:
        mapControl1.SearchPanelOptions.Visible = true;
        mapControl1.SearchPanelOptions.ShowNullValuePrompt = true;
        mapControl1.SearchPanelOptions.NullValuePrompt = "Type a location to search...";
        mapControl1.SearchPanelOptions.MaxVisibleItemCount = 3;
        mapControl1.SearchPanelOptions.Width = 200;
    }
vb
Imports DevExpress.XtraMap
    Private Sub OnFormLoad(ByVal sender As Object, ByVal e As EventArgs)
        ' Enable search:
        Dim infoLayer As InformationLayer = New InformationLayer()
        mapControl1.Layers.Add(infoLayer)
        Dim searchProvider As BingSearchDataProvider = New BingSearchDataProvider()
        infoLayer.DataProvider = searchProvider
        searchProvider.BingKey = bingKey
        ' Specify search panel options:
        mapControl1.SearchPanelOptions.Visible = True
        mapControl1.SearchPanelOptions.ShowNullValuePrompt = True
        mapControl1.SearchPanelOptions.NullValuePrompt = "Type a location to search..."
        mapControl1.SearchPanelOptions.MaxVisibleItemCount = 3
        mapControl1.SearchPanelOptions.Width = 200
    End Sub

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the Width property.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

winforms-map-use-openstreetmap-search-service/CS/OsmSearchSample/MainForm.cs#L24

csharp
mapControl.SearchPanelOptions.Width = 400;

See Also

MapSearchPanelOptions Class

MapSearchPanelOptions Members

DevExpress.XtraMap Namespace