Provides access to members that work with the number format dialog.
Product Availability
Available with ArcGIS Desktop.
Members
Description | ||
---|---|---|
DoModal | Displays the number format dialog. | |
NumberFormat | The current number format object. |
CoClasses that implement INumberFormatDialog
CoClasses and Classes | Description |
---|---|
NumberFormatDialog | Number Format Dialog object. |
Remarks
This example demonstrates how to use NumberFormatDialog. You would get m_app from the hook in ICommand::OnCreate().
[C#]
//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));
}
[Visual Basic .NET]
'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
See Also
IScientificNumberFormat Interface | PercentageFormat Class | INumberFormat Interface | INumericFormat Interface | FractionFormat Class | IPercentageFormat Interface | ILatLonFormat Interface | ILatLonFormat2 Interface | LatLonFormat Class | ICustomNumberFormat Interface | RateFormat Class | NumericFormat Class | ScientificFormat Class | IRateFormat Interface | AngleFormat Class | IFractionFormat Interface | CurrencyFormat Class | CustomNumberFormat Class | IAngleFormat Interface