none
How to get a color to the heading of a form. RRS feed

  • Question

  • When run a Project in Visual Studio I Always get a white border background in the header.

    How do I change that?

    Ingemar

    Wednesday, November 29, 2017 12:17 PM

Answers

  • When run a Project in Visual Studio I Always get a white border background in the header.

    How do I change that?

    Ingemar

     That is the default color used in Windows 10 for a Windows Form caption area.  It is a system wide setting which you have to set in your OS settings.  You can not change it for just the forms in your Windows Form application.  You only have a few options for doing that. One is to create a WPF application instead of Windows Form application as Cor suggested.  Another is you can use a Borderless form and draw the caption area yourself.  That would also require you to implement the rest of the caption options such as the caption Text and the Close, Minimize, and Minimize buttons.  Below is a few links with examples of doing that...

    Customize Titlebar

    Custom Form Border Style....

     Also,  if you do a quick search or two of the forum (link below),  you can find bunches of questions with solutions for this.

    Forum Search Result For - "custom titlebar"


    If you say it can`t be done then i`ll try it

    • Marked as answer by Ingo40 Wednesday, November 29, 2017 8:35 PM
    Wednesday, November 29, 2017 7:45 PM

All replies

  • Is this on one project or more than one project?

    Is this a Windows Forms project?

    What version of Windows?

    What version is being used for Visual Studio e.g. Visual Studio 2016 Community Edition?

    Does this happen when running from outside of Visual Studio?

    Does the white border remain throughout the running of the app?

    If only on load, what are you doing in the load event? 


    Please remember to mark the replies as answers if they help and unmark them if they provide no help, this will help others who are looking for solutions to the same or similar problem. Contact via my Twitter (Karen Payne) or Facebook (Karen Payne) via my MSDN profile but will not answer coding question on either.
    VB Forums - moderator
    profile for Karen Payne on Stack Exchange, a network of free, community-driven Q&A sites

    Wednesday, November 29, 2017 12:35 PM
    Moderator
  • Don't use windows forms but WPF. 

    Windows forms development ended in 2007. 

    Therefore the OS you use is still ordering which appearances it has. 

    https://docs.microsoft.com/en-us/dotnet/framework/wpf/getting-started/walkthrough-my-first-wpf-desktop-application


    Success
    Cor

    Wednesday, November 29, 2017 1:40 PM
  • It is a forms Project, I tested with WPF. but still no color on top of form.

    I tested to make a MessageBox.

    Windows 10 and Visual Studio 2017 Community

    Wednesday, November 29, 2017 4:20 PM
  • I tried the Expensit application and still no color on the form top.
    Wednesday, November 29, 2017 4:38 PM
  • Here it is shown and described with samples

    https://stackoverflow.com/questions/13170620/can-i-set-the-window-border-color-in-wpf

    Be aware all is XAML does fit VB.


    Success
    Cor

    Wednesday, November 29, 2017 4:45 PM
  • When run a Project in Visual Studio I Always get a white border background in the header.

    How do I change that?

    Ingemar

     That is the default color used in Windows 10 for a Windows Form caption area.  It is a system wide setting which you have to set in your OS settings.  You can not change it for just the forms in your Windows Form application.  You only have a few options for doing that. One is to create a WPF application instead of Windows Form application as Cor suggested.  Another is you can use a Borderless form and draw the caption area yourself.  That would also require you to implement the rest of the caption options such as the caption Text and the Close, Minimize, and Minimize buttons.  Below is a few links with examples of doing that...

    Customize Titlebar

    Custom Form Border Style....

     Also,  if you do a quick search or two of the forum (link below),  you can find bunches of questions with solutions for this.

    Forum Search Result For - "custom titlebar"


    If you say it can`t be done then i`ll try it

    • Marked as answer by Ingo40 Wednesday, November 29, 2017 8:35 PM
    Wednesday, November 29, 2017 7:45 PM