Title Bar Not Updating in Floating Window

3 posts, 1 answers
  1. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 01 Jul Link to this post

    I'm using 2017.2.613.40 of UI for WinForms

    I have a control hosted in a RadDock floating window.  When changes are made to my control I update the title bar of the host window with an asterisk:

    "test"

    becomes

    "test*"

    See attachments.

    However, the problem is that the change is not immediately visible.  I have to drag the window before the title will repaint.

    I'm using the following code to update the title bar after I acquire the HostWindow.

    hostWindow.Text = value;
    hostWindow.Invalidate(false);
    hostWindow.Update();
    hostWindow.Refresh();

    But none of these method calls forces the title to repaint.  The text value is clearly getting set properly because as soon as I manually trigger a repaint by dragging the window, the new title value appears.

     

  2. Answer
    Hristo
    Admin
    Hristo avatar
    1016 posts

    Posted 03 Jul Link to this post

    Hello Steve,

    Thank you for writing.

    If you are having a floating window you will also need to the explicitly set the text to the floating parent object. This way the changes will be immediately reflected: 
    public partial class RadForm1 : RadForm
    {
        public RadForm1()
        {
            InitializeComponent();
        }
     
        private void radButton1_Click(object sender, EventArgs e)
        {
            HostWindow hw = this.Parent as HostWindow;
            if (hw != null)
            {
                hw.Text = hw.Text + "*";
     
                if (hw.FloatingParent != null)
                {
                    hw.FloatingParent.Text = hw.Text;
                }
            }
        }
    }

    I am also sending you attached my test project as well as a short video showing the result on my end.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Progress Telerik
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
  3. Steve
    Steve avatar
    11 posts
    Member since:
    Jun 2013

    Posted 03 Jul in reply to Hristo Link to this post

    Thank you.  That solved the problem.  The title bar text now updates immediately with the following code.

    hostWindow.Text = value;
    if (hostWindow.FloatingParent != null)
    {
           hostWindow.FloatingParent.Text = value;
    }

Back to Top