Windows Develop Bookmark and Share   
 index > Windows Forms Designer > ControlPaint.DrawBorder3D Overrides Form Backcolor
 

ControlPaint.DrawBorder3D Overrides Form Backcolor

Hi,

I'm using the following code to add a border to my No-border-Form which has a special color, but when I apply the code, the form's color is set back to the original grey, so I would like to preserve the color specified (222, 223, 206), any ideas ?, thanks in advance !!!:


Private Sub Init_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles Me.Paint
        Dim Rect As Rectangle = Me.ClientRectangle()
        ControlPaint.DrawBorder3D(e.Graphics, Rect, Border3DStyle.RaisedOuter, Border3DSide.All)
    End Sub






George Waters  Monday, August 24, 2009 4:30 AM
Border3DSide.All includes Border3DSide.Middle and so the Middle is also painted.

You'll need to Or the top, left, bottom and right edges together.
Mick Doherty
http://dotnetrix.co.uk
Mick Doherty  Tuesday, August 25, 2009 5:49 PM
C'mon guys, anybody ?
George Waters  Tuesday, August 25, 2009 6:03 AM
Border3DSide.All includes Border3DSide.Middle and so the Middle is also painted.

You'll need to Or the top, left, bottom and right edges together.
Mick Doherty
http://dotnetrix.co.uk
Mick Doherty  Tuesday, August 25, 2009 5:49 PM
My God, this function was supposed to paint borders, not form's backcolor, isn't it called BORDER3DSide ?. Thanks Mick !!!
George Waters  Tuesday, August 25, 2009 7:35 PM

You can use google to search for other answers

Custom Search

More Threads

• displaying pictures from textboxes
• help with vs2005 crashing because of my code
• ControlX could not be set on Property 'Items'
• Children of a control incorrectly respond to the mouse popup menu interaction during design time.
• using IComponent Sites and Services infrastructure at runtime
• Using visual inheritance with the UserControl
• Does CodeDomComponentSerializationService Serialize nested controls?
• Menus in Inherited forms
• Readonly textbox - change forecolor
• IDesignerSerializationService.Deserialize now adds Components to IDesignerHost.Container