Calculator Control

5 posts, 0 answers
  1. Martin
    Martin avatar
    35 posts
    Member since:
    Jun 2014

    Posted 17 Nov 2015 Link to this post

    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.

  2. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 18 Nov 2015 Link to this post

    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
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Martin
    Martin avatar
    35 posts
    Member since:
    Jun 2014

    Posted 18 Nov 2015 in reply to Dimitar Link to this post

    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.

  5. Dimitar
    Admin
    Dimitar avatar
    1415 posts

    Posted 19 Nov 2015 Link to this post

    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
  6. Martin
    Martin avatar
    35 posts
    Member since:
    Jun 2014

    Posted 19 Nov 2015 in reply to Dimitar Link to this post

    Thanks Dimitar,

    It works a charm!

Back to Top
UI for WinForms is Visual Studio 2017 Ready