Class PopupCalculator
The PopupCalculator is a class derived from System.Windows.Forms.Control that embeds a CalculatorControl to display it in Popup Mode.
The PopupCalculator class includes a PopupControlContainer that it uses for displaying the drop down window.
The alignment of the Calculator Control with the parent control can be set through the PopupCalculatorAlignment property.
The embedded CalculatorControl itself can be accessed through the Calculator property.
This class also raises the BeforeCalculatorPopupDisplay event. PopupCalculatorAlignment property.
Inherited Members
Namespace: Syncfusion.Windows.Forms.Tools
Assembly: Syncfusion.Tools.Windows.dll
Syntax
public class PopupCalculator : BaseControl, IThemeProvider, IVisualStyle, IDisposable, ISupportOffice2007Theme
Constructors
PopupCalculator()
Initializes a new instance of the PopupCalculator class.
Declaration
public PopupCalculator()
Remarks
This constructor initializes the internal controls used for displaying the Calculator Control.
The initial value of the calculator needs to be set through the Value property.
Properties
BorderStyle
Sets the border style for the PopupCalculator.
Declaration
public Border3DStyle BorderStyle { set; }
Property Value
Type |
---|
System.Windows.Forms.Border3DStyle |
ButtonStyle
Sets the button style for the PopupCalculator.
Declaration
public ButtonAppearance ButtonStyle { set; }
Property Value
Type |
---|
ButtonAppearance |
Calculator
Gets the CalculatorControl that this PopupCalculator class embeds.
Declaration
public CalculatorControl Calculator { get; }
Property Value
Type |
---|
CalculatorControl |
Remarks
This is a read only property.
CloseAction
Gets or sets the action that will trigger closing the popup calculator.
Declaration
public CalcActions CloseAction { get; set; }
Property Value
Type |
---|
CalcActions |
EnableTouchMode
Gets or sets value to enable or disable the Touchmode to the controls.
Declaration
public bool EnableTouchMode { get; set; }
Property Value
Type |
---|
System.Boolean |
Remarks
Scale factor will be updated automatically if scalefactor is equal to 1
FlatStyle
Sets the flat style for the PopupCalculator.
Declaration
public FlatStyle FlatStyle { set; }
Property Value
Type |
---|
System.Windows.Forms.FlatStyle |
Font
Gets /Sets the font for the Control.
Declaration
public override Font Font { get; set; }
Property Value
Type |
---|
System.Drawing.Font |
LayoutType
Sets the Layout type for the PopupCalculator.
Declaration
public CalculatorLayoutTypes LayoutType { set; }
Property Value
Type |
---|
CalculatorLayoutTypes |
MetroColor
Gets or sets the metrocolor.
Declaration
public Color MetroColor { set; }
Property Value
Type |
---|
System.Drawing.Color |
Office2007ColorTheme
Gets or sets Office2007Theme to use.
Declaration
public Office2007Theme Office2007ColorTheme { get; set; }
Property Value
Type |
---|
Office2007Theme |
Office2007StyleEnabled
Gets a value indicating whether rendering with Office2007Theme is enabled.
Declaration
public bool Office2007StyleEnabled { get; }
Property Value
Type |
---|
System.Boolean |
ParentControl
Gets or sets the property is the same as the ParentControl property of the PopupControlContainer.
Declaration
public Control ParentControl { get; set; }
Property Value
Type |
---|
System.Windows.Forms.Control |
PopupCalculatorAlignment
Gets or sets the relative alignment of the Popup with the parent control.
Declaration
public CalculatorPopupAlignment PopupCalculatorAlignment { get; set; }
Property Value
Type |
---|
CalculatorPopupAlignment |
Remarks
Refer to the CalculatorPopupAlignment enumeration for the list of values that this can take.
Size
Sets the size of the PopupCalculator.
Declaration
public Size Size { set; }
Property Value
Type |
---|
System.Drawing.Size |
UseVisualStyle
Sets a value indicating whether to use visual styles.
Declaration
public bool UseVisualStyle { set; }
Property Value
Type |
---|
System.Boolean |
Value
Gets or sets the value for the PopupCalculator.
Declaration
public CalculatorValue Value { get; set; }
Property Value
Type |
---|
CalculatorValue |
Methods
ApplyScaleToControl(Single)
Scale the control based on the scale factor passed in the argument.
Declaration
public void ApplyScaleToControl(float scaleFactor)
Parameters
Type | Name | Description |
---|---|---|
System.Single | scaleFactor | value to scale the factor based upon. |
CloseCalculator()
Closes the popup calculator if it is displayed.
Declaration
public void CloseCalculator()
Remarks
This method is invoked when the CalculatorControl raises the Closing event.
DisplayCalculator()
Overloaded. Displays the calculator.
Declaration
public void DisplayCalculator()
Remarks
This is the method used to display the Popup Calculator itself. This method takes into account the CalculatorPopupAlignment and displays the Popup Calculator at the right position.
DisplayCalculator(Point)
Displays the calculator.
Declaration
public void DisplayCalculator(Point location)
Parameters
Type | Name | Description |
---|---|---|
System.Drawing.Point | location | The location to display the popup calculator. |
Remarks
This method displays the CalculatorControl and raises the BeforeCalculatorPopupDisplay event. This event allows the display to be canceled by a handler.
Dispose(Boolean)
Declaration
protected override void Dispose(bool disposing)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | disposing |
EnableOffice2007Style()
Enables rendering with Office2007Theme.
Declaration
public void EnableOffice2007Style()
HandleCalculatorValueCalculated(Object, CalculatorValueCalculatedEventArgs)
Declaration
public void HandleCalculatorValueCalculated(object sender, CalculatorValueCalculatedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
CalculatorValueCalculatedEventArgs | args |
HandleEnterKey()
Declaration
public void HandleEnterKey()
HandlePopupControlClosing(Object, PopupClosedEventArgs)
Declaration
public void HandlePopupControlClosing(object sender, PopupClosedEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.Object | sender | |
PopupClosedEventArgs | args |
InitializeCalculatorControl()
Declaration
protected virtual void InitializeCalculatorControl()
OnBeforeCalculatorPopupDisplay(CancelEventArgs)
Invokes the BeforeCalculatorPopupDisplay event.
Declaration
protected virtual bool OnBeforeCalculatorPopupDisplay(CancelEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
System.ComponentModel.CancelEventArgs | args | A BeforeCalculatorPopupDisplayEventArgs that contains the event data. |
Returns
Type | Description |
---|---|
System.Boolean | Returns Bool property. |
Remarks
The OnBeforeCalculatorPopupDisplay method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
note
Inheritors: When overriding OnBeforeCalculatorPopupDisplay in a derived class, be sure to call the base class's OnBeforeCalculatorPopupDisplay method so that registered delegates receive the event.
OnClosing(CalculatorClosingEventArgs)
Invokes the PopupCalculatorClosing event.
Declaration
protected virtual void OnClosing(CalculatorClosingEventArgs args)
Parameters
Type | Name | Description |
---|---|---|
CalculatorClosingEventArgs | args | A CancelEventArgs that contains the event data. |
Remarks
The OnPopupCalculatorClosing method also allows derived classes to handle the event without attaching a delegate. This is the preferred technique for handling the event in a derived class.
note
Inheritors: When overriding OnStyleChanged in a derived class, be sure to call the base class's OnStyleChanged method so that registered delegates receive the event.
OnFontChanged(EventArgs)
Font changed
Declaration
protected override void OnFontChanged(EventArgs e)
Parameters
Type | Name | Description |
---|---|---|
System.EventArgs | e |
RaiseBeforeCalculatorPopupDisplayEvent()
Raises the BeforeCalculatorPopupDisplay event.
Declaration
protected bool RaiseBeforeCalculatorPopupDisplayEvent()
Returns
Type | Description |
---|---|
System.Boolean | True if the Calculator display has been canceled by a event handler; false otherwise. |
Remarks
This event can be handled if you want to make some changes to the Calculator Control before it is displayed.
RaiseClosingEvent(CalculatorCloseType)
Raises the Closing event. This event is raised by the calculator control before the popup calculator closes when the '=' button is clicked. This event will not be raised when the popup calculator control closes when it loses focus.
Declaration
protected void RaiseClosingEvent(CalculatorCloseType closeType)
Parameters
Type | Name | Description |
---|---|---|
CalculatorCloseType | closeType | Calculator close type. |
Events
BeforeCalculatorPopupDisplay
Event raised before the calculator popup is displayed.
Declaration
public event CancelEventHandler BeforeCalculatorPopupDisplay
Event Type
Type |
---|
System.ComponentModel.CancelEventHandler |
Remarks
This event is a System.ComponentModel.CancelEventHandler type event. You can cancel the PopupCalculator from being displayed by handling this event.
Closing
Event raised by a popup calculator when closing after the '=' button was clicked.
Declaration
public event PopupCalculatorClosingEventHandler Closing
Event Type
Type |
---|
PopupCalculatorClosingEventHandler |
Remarks
By default the CalculatorControl will raise this event when the '=' equal button is clicked. This event can be canceled by a handler and the PopupCalculator will not be closed.