Friday, May 09, 2008  



 FarPoint Technologies
 (800) 645-5913

 fpsales@fpoint.com

 FarPoint Europe (UK)
 +44 (0) 1798 812 372

 salesEurope@fpoint.com

     
 »Input Pro »Product Tour » fpLongInteger

Previous fpLongInteger Control Next

The fpLongInteger control is a formatted edit control that supports integers or long integers and supports many numeric formats.

You can limit the range of values allowed in the control by specifying minimum and maximum values, customize how the user interacts with the control, and add buttons to the control to customize user interaction.

Displaying a Separator Character | Working with Negative Numbers | Customizing User Entry | Setting and Returning Integer Values | Providing Buttons | Validating Integer Data

Back to Top
 Displaying a Separator Character
   You can group digits using a separator character to assist readability. For example, it is common in the United States to represent large figures with commas separating every three digits to show multiples of one thousand, as shown in the figure.

By default, the fpLongInteger control does not display a separator character. If you format the control to display a separator character, but do not specify the character to display, the control displays the separator character specified by the international or regional Windows settings.

 Back to Top
 Working with Negative Numbers
   You can customize the format for displaying negative numbers. You can also let the user toggle the control's value between positive and negative by pressing the hyphen key or the minus key on the numeric keypad.

By default, the fpLongnteger control displays a negative value as a minus sign followed by the numeric value. You can specify that the control display any of the formats illustrated to the right.

  Back to Top
 Customizing User Entry
   By default, user entry is restricted because the fpLongInteger control checks each character as the user types it or when the user pastes data into the control. If the user tries to type or paste a character that is not valid for the control then the control does not accept the character and a UserError event occurs. You can specify that the control beeps when the user types or pastes an invalid character as well.

If you prefer, you can configure the control so it does not check each character as it is supplied, and lets the user type or paste invalid characters. The value supplied to the fpLongInteger control can contain only numbers (though the control can supply additional formatting characters, such as a separator character).


  Back to Top
 Setting and Returning Integer Values
   You can set integer values using the Text property. You can return integer values with or without formatting characters as a string or number.

Three properties and one function/method return the value of the control. They differ in whether they return the formatting of the value, and whether they return the value as a string or as a number.

Text
Returns the value as a string including the formatting, such as the negative format

UnFmtText or Value
Returns value as string with no formatting

LongValue
Returns value as number with no formatting

  Back to Top
 Providing Buttons
   The fpLongInteger control can display buttons to let the user quickly change the value in the control without typing. You can choose which type of buttons to display and the amount by which the value of the control changes when the user clicks a button.

A commonly used button style for the fpLongInteger control is the spin button. By default, spin buttons increment and decrement the value of the control. You can specify the amount by which the integer value is changed.

  Back to Top
 Validating Integer Data
NOTE: Be sure to read the Customizing User Entry section above for information on validation of data while being entered by the user.

   When the fpLongInteger control loses the focus, it checks the value of the control to see whether it is valid. Valid values are defined as numeric values, and values are limited by the settings of the MinValue and MaxValue properties. If an invalid value is received, the InvalidData event occurs after the control loses the focus.

You can change the fpLongInteger control's appearance to reflect that it has received invalid data. In addition, you can specify whether and how invalid data is displayed.

You can specify whether the control allows the Null value. If the control allows the Null value as a valid value, the control is blank when it contains the Null value, and it displays as its background color the color specified by the NullColor property. Otherwise, the control displays its default value, zero.

Previous fpLongInteger Control Next

    
 Have a question?
Have a Question? Ask Us!
Subscribe to the RSS feed!RSS Subscribe
 

 
SD Times 'TOP 100' Industry Innovator - Read the press release (pdf)


Input Pro Tour
fpBoolean Control
fpCurrency Control
fpDateTime Control
fpDoubleSingle Control
fpLongInteger Control
fpMask Control
fpMemo Control
fpText Control
Rate this Tour

Copyright © 1991-2007 FarPoint Technologies, Inc. All rights reserved. All names are property of their respective owners.