-
Notifications
You must be signed in to change notification settings - Fork 119
ProGuide Edit Boxes
Language: C#
Subject: Framework
Contributor: ArcGIS Pro SDK Team <arcgisprosdk@esri.com>
Organization: Esri, http://www.esri.com
Date: 10/06/2024
ArcGIS Pro: 3.4
Visual Studio: 2022
-
How to declare an Edit box
-
Control the enabled state of an Edit box using a condition
-
Restricting entered text to a particular data type
-
Setting an edit hint
-
Setting the initial value
-
Providing validation
Edit boxes provide a convenient means for users to enter text within a control on a ribbon tab. They are declared in DAML using the editBox element within the controls container.
An Edit box is declared using the id, className, and sizeString attributes. It can be configured to appear with or without a caption. Use the smallImage attribute to have an image displayed with the control. The image is positioned to the left of any caption.
The sizeString attribute is used to establish the width of the control. This string is representative of the kind of input that appears in the control. The sizeString attribute can also be updated at runtime.
The Edit box is referenced on a group using the editBox control with the refID attribute.
<groups>
<group id="MyCustomFilterGroup" caption="Filter">
<editBox refID="MyCustomEditBox" size="medium"/>
</group>
</groups>
<controls>
<editBox id="MyCustomEditBox" caption="Filter Text:" keytip="F"
className="MyEditBox" disableIfBusy="false"
sizeString="1234567890123456789012" condition="esri_mapping_domainsPane">
<tooltip heading="">Type filter text.<disabledText></disabledText></tooltip>
</editBox>
</controls>
The className attribute references the Edit box implementation. This is a class that inherits from the ArcGIS.Desktop.Framework.Contracts.EditBox base class.
internal class MyEditBox : ArcGIS.Desktop.Framework.Contracts.EditBox
{
public MyEditBox()
{
Text = "";
}
}
Use the condition attribute to assign a predefined condition. For more information about defining states and conditions within DAML, see that section.
<editBox id="MyCustomEditBox" caption="Filter Text:" keytip="F" className="MyEditBox" disableIfBusy="false"
sizeString="1234567890" condition="esri_mapping_domainsPane">
<tooltip heading="">Type filter text.<disabledText></disabledText></tooltip>
</editBox>
The editBox control provides a dataType attribute that allows the control to restrict the text entered by the user. The default value is string.
<editBox id="MyCustomEditBox" caption="Filter Text:" className="MyEditBox" disableIfBusy="false"
smallImage="Images\GenericButtonBlue16.png" dataType="int64"
sizeString="1234" >
<tooltip heading="">
Type filter text.<disabledText></disabledText>
</tooltip>
</editBox>
<editBox id="MyCustomEditBox" caption="Filter Text:" className="MyEditBox" disableIfBusy="false"
smallImage="Images\GenericButtonBlue16.png" dataType="double"
sizeString="1234" >
<tooltip heading="">
Type filter text.<disabledText></disabledText>
</tooltip>
</editBox>
<editBox id="MyCustomEditBox" caption="Filter Text:" className="MyEditBox" disableIfBusy="false"
smallImage="Images\GenericButtonBlue16.png" dataType="string"
sizeString="123456789" >
<tooltip heading="">
Type filter text.<disabledText></disabledText>
</tooltip>
</editBox>
Use the editHint attribute to display a descriptive text label within the item when it's empty.
<editBox id="MyCustomEditBox" caption="Filter Text:" className="MyEditBox" disableIfBusy="false"
smallImage="Images\GenericButtonBlue16.png" dataType="string"
sizeString="1234567890123456789012" editHint="(Enter text)">
<tooltip heading="">
Type filter text.<disabledText></disabledText>
</tooltip>
</editBox>
In the constructor of your Edit box class use the Text runtime property to set the initial value.
internal class MyEditBox : ArcGIS.Desktop.Framework.Contracts.EditBox
{
public MyEditBox()
{
Text = "";
}
}
The base ArcGIS.Desktop.Framework.Contracts.EditBox class provides OnEnter and OnTextChange methods that can be overridden by your implemented class to provide validation and/or custom action when the user enters text into the Edit box. See the code snippets below for how this looks.
<groups>
<group id="MyCustomFilterGroup" caption="Filter">
<editBox refID="MyCustomEditBox" size="medium"/>
</group>
</groups>
<controls>
<editBox id="MyCustomEditBox" caption="Filter Text:" className="MyEditBox" disableIfBusy="false"
smallImage="Images\GenericButtonBlue16.png" dataType="string"
sizeString="1234678901234567890" >
<tooltip heading="">
Type filter text.<disabledText></disabledText>
</tooltip>
</editBox>
</controls>
internal class MyEditBox : ArcGIS.Desktop.Framework.Contracts.EditBox
{
public MyEditBox()
{
Text = "";
}
protected override void OnEnter()
{
// TODO - add specific validation code here
}
protected override void OnTextChange(string text)
{
// TODO - add specific validation code here
}
}
Home | API Reference | Requirements | Download | Samples
- Overview of the ArcGIS Pro SDK
- What's New for Developers at 3.4
- Installing ArcGIS Pro SDK for .NET
- Release notes
- Resources
- Pro SDK Videos
- ProSnippets
- ArcGIS Pro API
- ProGuide: ArcGIS Pro Extensions NuGet
Migration
- ProSnippets: Framework
- ProSnippets: DAML
- ProConcepts: Framework
- ProConcepts: Asynchronous Programming in ArcGIS Pro
- ProConcepts: Advanced topics
- ProGuide: Custom settings
- ProGuide: Command line switches for ArcGISPro.exe
- ProGuide: Reusing ArcGIS Pro Commands
- ProGuide: Licensing
- ProGuide: Digital signatures
- ProGuide: Command Search
- ProGuide: Keyboard shortcuts
Add-ins
- ProGuide: Installation and Upgrade
- ProGuide: Your first add-in
- ProGuide: ArcGIS AllSource Project Template
- ProConcepts: Localization
- ProGuide: Content and Image Resources
- ProGuide: Embedding Toolboxes
- ProGuide: Diagnosing ArcGIS Pro Add-ins
- ProGuide: Regression Testing
Configurations
Customization
- ProGuide: The Ribbon, Tabs and Groups
- ProGuide: Buttons
- ProGuide: Label Controls
- ProGuide: Checkboxes
- ProGuide: Edit Boxes
- ProGuide: Combo Boxes
- ProGuide: Context Menus
- ProGuide: Palettes and Split Buttons
- ProGuide: Galleries
- ProGuide: Dockpanes
- ProGuide: Code Your Own States and Conditions
Styling
- ProSnippets: Content
- ProSnippets: Browse Dialog Filters
- ProConcepts: Project Content and Items
- ProConcepts: Custom Items
- ProGuide: Custom Items
- ProGuide: Custom browse dialog filters
- ArcGIS Pro TypeID Reference
- ProSnippets: Editing
- ProConcepts: Editing
- ProConcepts: COGO
- ProConcepts: Annotation Editing
- ProConcepts: Dimension Editing
- ProGuide: Editing Tool
- ProGuide: Sketch Tool With Halo
- ProGuide: Construction Tools with Options
- ProGuide: Annotation Construction Tools
- ProGuide: Annotation Editing Tools
- ProGuide: Knowledge Graph Construction Tools
- ProGuide: Templates
3D Analyst Data
Plugin Datasources
Topology
Linear Referencing
Object Model Diagram
- ProSnippets: Geometry
- ProSnippets: Geometry Engine
- ProConcepts: Geometry
- ProConcepts: Multipatches
- ProGuide: Building Multipatches
Relational Operations
- ProSnippets: Knowledge Graph
- ProConcepts: Knowledge Graph
- ProGuide: Knowledge Graph Construction Tools
Reports
- ProSnippets: Map Authoring
- ProSnippets: Annotation
- ProSnippets: Charts
- ProSnippets: Labeling
- ProSnippets: Renderers
- ProSnippets: Symbology
- ProSnippets: Text Symbols
- ProConcepts: Map Authoring
- ProConcepts: Annotation
- ProConcepts: Dimensions
- ProGuide: Tray buttons
- ProGuide: Custom Dictionary Style
- ProGuide: Geocoding
3D Analyst
CIM
Graphics
Scene
Stream
Voxel
- ProSnippets: Map Exploration
- ProSnippets: Custom Pane with Contents
- ProConcepts: Map Exploration
- ProGuide: Map Pane Impersonation
- ProGuide: TableControl
Map Tools
- ProGuide: Feature Selection
- ProGuide: Identify
- ProGuide: MapView Interaction
- ProGuide: Embeddable Controls
- ProGuide: Custom Pop-ups
- ProGuide: Dynamic Pop-up Menu
Network Diagrams
- ArcGIS Pro API Reference Guide
- ArcGIS Pro SDK (pro.arcgis.com)
- arcgis-pro-sdk-community-samples
- ArcGISPro Registry Keys
- ArcGIS Pro DAML ID Reference
- ArcGIS Pro Icon Reference
- ArcGIS Pro TypeID Reference
- ProConcepts: Distributing Add-Ins Online
- ProConcepts: Migrating to ArcGIS Pro
- FAQ
- Archived ArcGIS Pro API Reference Guides
- Dev Summit Tech Sessions