====== jNumpad ====== The [[https://api.comfiletech.com/csharp/api/ComfileTech.jControlsNF4.jNumpad.html|jNumpad]] control is a composite control of [[jcontrols_nf4:jbutton:index|jButtons]] and [[jcontrols_nf4:jlabel:index|jLabels]] that can be used to accept numeric input from the operator. Like most controls in the jControls NF4 library, it has a rich appearance, employing jControls NF4's [[jcontrols_nf4:fills_and_borders:index|fill, border]], [[jcontrols_nf4:shape_and_cornerradii:index|corner radii]], and [[jcontrols_nf4:gloss_and_dropshadow:index#dropshadow_property|drop shadow]], along with a few additional features. ===== Button Properties ===== The jNumpad control has 15 buttons, each of which are exposed as properties. |{{jnumpad_buttons.png}}|{{jnumpad_buttons_properties.png}}| Because they are exposed as properties, their appearance can be customized in the designer. | {{jnumpad_buttons_red.png}} | {{jnumpad_buttons_red_properties.png}} | ===== TitleLabel Property ===== The [[https://api.comfiletech.com/csharp/api/ComfileTech.jControlsNF4.jNumpad.TitleLabel.html#ComfileTech_jControlsNF4_jNumpad_TitleLabel|TitleLabel]] property is a [[jcontrols_nf4:jlabel:index|jLabel]] that serves as the title bar of the jNumpad. | {{jnumpad_titlelabel.png}} | {{jnumpad_titlelabel_properties.png}} | ===== ValueLabel Property ===== The [[https://api.comfiletech.com/csharp/api/ComfileTech.jControlsNF4.jNumpad.ValueLabel.html|ValueLabel]] property is a [[jcontrols_nf4:jlabel:index|jLabel]] that serves to display the value as it is entered by the operator. | {{jnumpad_valuelabel.png}} | {{jnumpad_valuelabel_properties.png}} | ===== ClearOnEdit Property ===== When set to ''true'' the [[https://api.comfiletech.com/csharp/api/ComfileTech.jControlsNF4.jNumpad.ClearOnEdit.html|ClearOnEdit]] property will clear the [[#value_label|ValueLabel]] when the operator first starts entering a value. ===== MaxLength Property ===== The [[https://api.comfiletech.com/csharp/api/ComfileTech.jControlsNF4.jNumpad.MaxLength.html|MaxLength]] property sets an upper bound on the number of characters the operator can enter. ===== InputCommitted Event ===== The [[https://api.comfiletech.com/csharp/api/ComfileTech.jControlsNF4.jNumpad.InputCommitted.html|InputCommitted]] event is fired when the operator presses the Enter button. ===== InputCancelled Event ===== The [[https://api.comfiletech.com/csharp/api/ComfileTech.jControlsNF4.jNumpad.InputCancelled.html|InputCancelled]] event is fired when the operator presses the Cancel button. ===== Showing the jNumpad at Runtime ===== Typically the jNumpad would be added to a [[jcontrols_nf4:jusercontrol:index|jUserConrol]] that is large enough to cover the screen. To show the jNumpad, the jUserControl would then be added to a jForm at runtime displayed in front of all other controls with the [[https://learn.microsoft.com/en-us/dotnet/api/system.windows.forms.control.bringtofront?view=netframework-4.8.1|BringToFront]] method. Because the jUserControl covers the screen and is displayed in front of all other controls, it prevents the operator from touching any other control except the jNumpad. When the operator confirms the input by pressing either the Enter or Cancel buttons, the jUserControl is then removed from the jForm, dismissing the jNumpad. To see a demonstration of this technique, please see the Showcase Visual Studio project template. {{ :jcontrols_nf4:jnumpad:jnumpad_demo.mp4?800x480 }}