how to auto hide radtitle bar in fullscreen form

5 posts, 0 answers
  1. mohammad reza
    mohammad reza avatar
    9 posts
    Member since:
    Aug 2016

    Posted 08 Aug Link to this post

    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 ?

  2. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 08 Aug Link to this post

    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.
  3. UI for WinForms is Visual Studio 2017 Ready
  4. mohammad reza
    mohammad reza avatar
    9 posts
    Member since:
    Aug 2016

    Posted 08 Aug in reply to Dess Link to this post

    thanks Dess

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

    title bar hide for ever in maximized radform !!!

     

  5. Dess
    Admin
    Dess avatar
    1609 posts

    Posted 08 Aug Link to this post

    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.
  6. mohammad reza
    mohammad reza avatar
    9 posts
    Member since:
    Aug 2016

    Posted 09 Aug in reply to Dess Link to this post

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

     

    thanks Dess.
    that is nice idea!!

Back to Top
UI for WinForms is Visual Studio 2017 Ready