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

Title Bar Not Updating in Floating Window

2 Answers 198 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 01 Jul 2017, 11:41 PM

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 Answers, 1 is accepted

Sort by
0
Accepted
Hristo
Telerik team
answered on 03 Jul 2017, 08:08 AM
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.
0
Steve
Top achievements
Rank 1
answered on 03 Jul 2017, 03:58 PM

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;
}

Tags
Dock
Asked by
Steve
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Steve
Top achievements
Rank 1
Share this question
or