DoubleClick in a Tabbed Document

2 posts, 0 answers
  1. simtemp
    simtemp avatar
    1 posts
    Member since:
    Sep 2007

    Posted 05 Apr 2010 Link to this post

    Hi,
    how to close a DocumentWindow DoubleClicking the TabHeader

    TIA

  2. Nikolay
    Admin
    Nikolay avatar
    1803 posts

    Posted 08 Apr 2010 Link to this post

    Hi simtemp,

    You can subscribe to the Click event of DocumentWindow.TabStripItem and check whether the time span between the clicks is small enough:

    public Form1()
    {
        InitializeComponent();
      
        this.documentWindow1.TabStripItem.Click += new EventHandler(TabStripItem_Click);
    }
      
    DateTime startClick = DateTime.MinValue;
      
    void TabStripItem_Click(object sender, EventArgs e)
    {
        DateTime currentTime = DateTime.Now;
        TimeSpan span = currentTime - startClick;
        if (span.TotalMilliseconds < SystemInformation.DoubleClickTime)
        {
            this.radDock1.CloseWindow(this.documentWindow1);
        }
        startClick = currentTime;
    }


    All the best,
    Nikolay
    the Telerik team

    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 Public Issue Tracking system and vote to affect the priority of the items.
  3. UI for WinForms is Visual Studio 2017 Ready
Back to Top