How to set background color window to RGB color

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Sylvain
    New Member
    • Apr 2012
    • 1

    How to set background color window to RGB color

    I'm making a WPF application in VS2010. I'm trying to set the background color of the form to a specific color expressed in RGB. However, when I debug, i get a black form. The copypasted code:

    Public Class Window1

    Private Sub Window1_Loaded( ByVal sender As Object, ByVal e As System.Windows. RoutedEventArgs ) Handles Me.Loaded

    Dim clrColor As New System.Windows. Media.Color

    clrColor.R = 20
    clrColor.G = 50
    clrColor.B = 100

    Dim s As New SolidColorBrush

    s.Color = clrColor

    Me.Background = s
    End Sub
    End Class
Working...