This document is archived and information here might be outdated. Recommended version. |
ArcObjects Help for .NET developers > ArcObjects namespaces > Framework > ESRI.ArcGIS.Framework > Interfaces > IN > INumberFormatDialog Interface (ArcObjects .NET 10.5 SDK) |
Provides access to members that work with the number format dialog.
Description | ||
---|---|---|
DoModal | Displays the number format dialog. | |
NumberFormat | The current number format object. |
CoClasses and Classes | Description |
---|---|
NumberFormatDialog | Number Format Dialog object. |
This example demonstrates how to use NumberFormatDialog. You would get m_app from the hook in ICommand::OnCreate().
//Setup the NumericFormat
INumericFormat numericFormat=new NumericFormatClass();
numericFormat.RoundingOption=esriRoundingOptionEnum.esriRoundNumberOfDecimals;
numericFormat.RoundingValue=3;
numericFormat.ShowPlusSign=true;
numericFormat.UseSeparator=true;
//Set the NUmberFormatDialog's NumberFormat property
INumberFormatDialog numFormatDlg=new NumberFormatDialogClass();
numFormatDlg.NumberFormat=numericFormat as INumberFormat;
// Open the dialog on the application's window
if (numFormatDlg.DoModal(m_app.hWnd))
{
INumberFormat numFormat=numFormatDlg.NumberFormat;
System.Windows.Forms.MessageBox.Show(numFormat.ValueToString(12345.6789));
}
'Setup the NumericFormat
Dim numericFormat As INumericFormat=New NumericFormatClass()
numericFormat.RoundingOption=esriRoundingOptionEnum.esriRoundNumberOfDecimals
numericFormat.RoundingValue=3
numericFormat.ShowPlusSign=True
numericFormat.UseSeparator=True
'Set the NUmberFormatDialog's NumberFormat property
Dim numFormatDlg As INumberFormatDialog=New NumberFormatDialogClass()
numFormatDlg.NumberFormat=TryCast(numericFormat, INumberFormat)
' Open the dialog on the application's window
If numFormatDlg.DoModal(m_app.hWnd) Then
Dim numFormat As INumberFormat=numFormatDlg.NumberFormat
System.Windows.Forms.MessageBox.Show(numFormat.ValueToString(12345.6789))
End If
CurrencyFormat Class | IScientificNumberFormat Interface | FractionFormat Class | IPercentageFormat Interface | INumericFormat Interface | IFractionFormat Interface | NumericFormat Class | IAngleFormat Interface | LatLonFormat Class | ICustomNumberFormat Interface | PercentageFormat Class | ILatLonFormat2 Interface | ILatLonFormat Interface | RateFormat Class | IRateFormat Interface | CustomNumberFormat Class | INumberFormat Interface | ScientificFormat Class | AngleFormat Class