Contents
sfDoubleTextBox
Overview
sfDoulbeTextBox is a Dyalog namespace that shows examples on how to use the Syncfusion DoubleTextBox control. The DoubleTextBox control restricts text box input to only numeric values with support for data binding, Watermark, Null Value, Blendability, and culture support. It provides many customization options to enhance its appearance and to suit your applications.
The core features of the DoubleTextBox are as follows:
Provides the ability to control the range of input values by using the MinValue and MaxValue properties.
- Provides different foreground brushes for positive, negative, and zero values.
- Provides data binding support.
- Provides built-in Visual Styles and themes.
- Provides Watermark support.
- Provides Number Format support.
- Provides Blendability support.
- Provides Null Value support.
- Provides culture support.
Installation and deployment
The following assemblies (version 12.1 or newer) are required in the subdirectory /Syncfusion/4.5 of the Dyalog APL version 14 (or newer) directory:
- Syncfusion.Shared.Wpf.dll
Using MinValue and MaxValue for Validation on Lost Focus
Here is the steps to use Validation on Lost Focus with a MinValue and MaxValue:
Set the MinValue and MaxValue properties.
Set the MinValidation and MaxValidation properties to OnLostFocus.
Set the event onValueChanged to _DoubleTextBox_ValueChangedEvent.
rootObject.doubleTextBox1.(MinValue MaxValue)←1 100 rootObject.doubleTextBox1.(MinValidation MaxValidation)←rootObject.doubleTextBox1.(MinValidation.OnLostFocus MaxValidation.OnLostFocus) rootObject.doubleTextBox1.onValueChanged←'_DoubleTextBox_ValueChangedEvent'
How it works: Each time there is a new value that is entered in the DoubleText box, the function _DoubleTextBox_ValueChangedEvent is called to verify that it is within the MinValue and the MaxValue. If not, a tooltip (Warning_ToolTip_xaml) will appear to warn the user that the value entered is either too high or too low. When the DoubleText box is loosing focus, if the value is still too high or too low, it will be truncated to the nearest of the MinValue or MaxValue.
The function DemoDoubleTextBox1 shows an example that looks like this:
How to install sfDoubleTextBox in your workspace
Download sfDoubleTextBox.v1.1.txt
- Do a Select all (Ctrl+A) and a copy (Ctrl+C).
In your workspace execute )ed ⍟ sfDoubleTextBox
- Paste (Ctrl+V) the text into the Dyalog editor
- Press Escape and ')save' your workspace
Optionally to de-script the namespace you can do:
#.sfDoubleTextBox←{('n' ⎕NS ⍵)⊢n←⎕NS ''}#.sfDoubleTextBox
Version Information
Original author: |
Pierre Gilbert |
Responsible: |
|
Email: |
<apgil AT SPAMFREE videotron DOT ca> |
CategoryDyalog - CategoryDyalogDotNet - CategorySyncfusionWpfExamples - CategoryDotNet