This is a migrated thread and some comments may be shown as answers.

Calculator Control

4 Answers 116 Views
Calendar, DateTimePicker, TimePicker and Clock
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 17 Nov 2015, 05:34 PM

Hi folks,

Is there a way for the calculator control to be permanently 'dropped down'? I want to be have a control on a form so it can be dragged around the screen. and have it permanently anchored to the form it is on.

Thanks folks.

4 Answers, 1 is accepted

Sort by
0
Dimitar
Telerik team
answered on 18 Nov 2015, 12:44 PM
Hi Martin,

Thank you for writing.

You can use the PopupClosing event to cancel the close operation and you can show the drop down when the form is loaded:
protected override void OnLoad(EventArgs e)
{
    base.OnLoad(e);
    radCalculatorDropDown1.CalculatorElement.PopupClosing += CalculatorElement_PopupClosing;
    radCalculatorDropDown1.CalculatorElement.ShowPopup();
}
void CalculatorElement_PopupClosing(object sender, Telerik.WinControls.UI.RadPopupClosingEventArgs args)
{
    args.Cancel = true;
}

Let me know if you have additional questions.
 
Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 18 Nov 2015, 02:59 PM

Hi Dimitar,

I've done as you suggest, but I'm finding the calculator is 'floating' so when the form is moved, the calculator stays behind, as if it is not a control on the form.

I wish it to be anchored and sized to the width of the radform (fixedtoolwindow) so it moves as the form is dragged around the screen, and also matches the opacity of the form which can be adjusted.

Many thanks,

Martin.

0
Dimitar
Telerik team
answered on 19 Nov 2015, 02:52 PM
Hello Martin,

Thank you for writing back.

You can move the drop down along with the form. For example you can change the drop-down location in the LocationChanged event:
void RadForm1_LocationChanged(object sender, EventArgs e)
{
    var newLoc = new Point(this.radCalculatorDropDown1.Location.X + this.Location.X + 4, this.radCalculatorDropDown1.Bounds.Bottom + this.Location.Y + this.FormElement.TitleBar.ControlBoundingRectangle.Height);
    this.radCalculatorDropDown1.CalculatorElement.Popup.Location = (newLoc);
}

Please let me know if there is something else I can help you with. 

Regards,
Dimitar
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
Martin
Top achievements
Rank 1
answered on 19 Nov 2015, 04:34 PM

Thanks Dimitar,

It works a charm!

Tags
Calendar, DateTimePicker, TimePicker and Clock
Asked by
Martin
Top achievements
Rank 1
Answers by
Dimitar
Telerik team
Martin
Top achievements
Rank 1
Share this question
or