CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 4 of 4
  1. #1
    Join Date
    Apr 2006
    Posts
    16

    Customizing form border

    The form border color is currently blue in color. But there seem no way to change its color.

    Is there a way to change its color?

    Is there a way to customize the border without using FormBorderStyle. Form Border Style seems to change the form border, to make it more 3D or less 3 D only. But I wanted to change it drastically, make the border look extremely different....i hope u know wat i mean.

  2. #2
    Join Date
    Jun 2005
    Posts
    121

    Re: Customizing form border

    Hi,
    Yes there is.You will have to override you Window procedure method :
    Code:
    protected override void WndProc(ref Message m)
    {
                if(m.Msg == 0x0085)    //msg id for WM_NCPAINT 
                {
                       //do your drawing
                       return;
                }
                base.WndProc(ref m);
    }
    You will have to pay attention WM_NCCALCSIZE to calculate the size and postion on non client area.

  3. #3
    Join Date
    Dec 2003
    Location
    http://map.search.ch/zuerich.en.html
    Posts
    1,074

    Re: Customizing form border

    Quote Originally Posted by hanct
    The form border color is currently blue in color. But there seem no way to change its color.

    Is there a way to change its color?
    Since the colour is determined by the OS theme, the simplest way is to select a different theme on your PC!
    Quote Originally Posted by hanct
    Is there a way to customize the border without using FormBorderStyle. Form Border Style seems to change the form border, to make it more 3D or less 3 D only. But I wanted to change it drastically, make the border look extremely different....i hope u know wat i mean.
    If you want to change it "drastically", then the easiest solution *is* to use FormBorderStyle.None and draw everything yourself.
    Useful? Then click on (Rate This Post) at the top of this post.

  4. #4
    Join Date
    Apr 2006
    Posts
    16

    Talking Re: Customizing form border

    Thanks for both reply. Think I try to override the window procedure..though i not sure what code to write in the overriding procedure to change the border color (I will search internet for tat)

    I cannot change the theme for my PC....cos creating application is for other people to use...not for myself to use...i cannot expect users to change theme.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured