Click to See Complete Forum and Search --> : Customizing form border


hanct
April 14th, 2006, 07:08 AM
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.

stepi
April 14th, 2006, 09:32 AM
Hi,
Yes there is.You will have to override you Window procedure method :

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.

Norfy
April 15th, 2006, 07:02 AM
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! :)

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.

hanct
April 15th, 2006, 09:29 AM
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.