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

how to auto hide radtitle bar in fullscreen form

4 Answers 147 Views
TitleBar
This is a migrated thread and some comments may be shown as answers.
mohammad reza
Top achievements
Rank 1
mohammad reza asked on 08 Aug 2016, 07:13 AM

hi.

i want to have a fullscreen form with auto hide title bar like "Microsoft Remote Desktop" or so on.

is there a way to implement it with telerik winform components ?

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Aug 2016, 07:41 AM
Hello Mohammad,

Thank you for writing. 

You can detect when the form is maximized and hide its title bar programmatically. Here is a sample code snippet:
public Form1()
{
    InitializeComponent();
 
    this.SizeChanged+=Form1_SizeChanged;
}
 
private void Form1_SizeChanged(object sender, EventArgs e)
{
    if (this.WindowState == FormWindowState.Maximized)
    {
        this.FormElement.TitleBar.Visibility = Telerik.WinControls.ElementVisibility.Collapsed;
    }
    else
    {
     
        this.FormElement.TitleBar.Visibility = Telerik.WinControls.ElementVisibility.Visible;
    }
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
mohammad reza
Top achievements
Rank 1
answered on 08 Aug 2016, 07:55 AM

thanks Dess

but when i set "TitleBar.Visibility = ElementVisibility.Collapsed"

title bar hide for ever in maximized radform !!!

 

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 08 Aug 2016, 08:57 AM
Hello Mohammad, 

Thank you for writing back. 

Indeed, the title bar is collapsed. Autohiding functionality for the title bar is not supported out of the box. You can handle the MouseMove event of the form and make the title bar visible when the cursor is close to the title bar:
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
    if (this.WindowState == FormWindowState.Maximized)
    {
        if (e.Y < 20)
        {
            this.FormElement.TitleBar.Visibility = Telerik.WinControls.ElementVisibility.Visible;
        }
    }
}

Note that this is just a sample approach and it may not cover all possible cases. Feel free to modify it in a way which suits your requirement best.

I hope this information helps.

Regards,
Dess
Telerik by Progress
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
mohammad reza
Top achievements
Rank 1
answered on 09 Aug 2016, 05:40 AM
[quote]Dess said:Hello Mohammad, 

Thank you for writing back. 

Indeed, the title bar is collapsed. Autohiding functionality for the title bar is not supported out of the box. You can handle the MouseMove event of the form and make the title bar visible when the cursor is close to the title bar:
private void Form1_MouseMove(object sender, MouseEventArgs e)
{
    if (this.WindowState == FormWindowState.Maximized)
    {
        if (e.Y < 20)
        {
            this.FormElement.TitleBar.Visibility = Telerik.WinControls.ElementVisibility.Visible;
        }
    }
}

[/quote]

 

thanks Dess.
that is nice idea!!

Tags
TitleBar
Asked by
mohammad reza
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
mohammad reza
Top achievements
Rank 1
Share this question
or