OnLocationChanged event isn't fired when ToolWindow is floating

2 posts, 0 answers
  1. Gerben
    Gerben avatar
    14 posts
    Member since:
    Jul 2010

    Posted 10 Sep 2010 Link to this post

    For a project, i need to resize ToolWindows when they are floating, and are at a certain position at the screen, but the onlocationChange event isn't fired when I move the floating window on the screen

    It is fired  before i make the window floating.

    I'm using the 2010 Q2 SP1 release.
  2. Stefan
    Stefan avatar
    2891 posts

    Posted 17 Sep 2010 Link to this post

    Hi Gerben,

    Thank you for the question.

    When you float a ToolWindow, you should subscribe to the LocationChanged property of the ToolWindow's FloatingParent. Let's assume that we have a docked ToolWindow that the user floats at runtime. The code that will allow you to track the location changes of the floating form is:
    public partial class Form1 : Form
        public Form1()
            this.radDock1.DockStateChanged += new Telerik.WinControls.UI.Docking.DockWindowEventHandler(radDock1_DockStateChanged);
        FloatingWindow floatingW;
        void radDock1_DockStateChanged(object sender, Telerik.WinControls.UI.Docking.DockWindowEventArgs e)
            if (e.DockWindow.DockState == Telerik.WinControls.UI.Docking.DockState.Floating)
                floatingW = e.DockWindow.FloatingParent;
                floatingW.LocationChanged += new EventHandler(floating_LocationChanged);
        void floating_LocationChanged(object sender, EventArgs e)

    I hope this helps.
    Sincerely yours,
    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. DevCraft banner
Back to Top