By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,990 Members | 2,138 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,990 IT Pros & Developers. It's quick & easy.

How to set background color window to RGB color

P: 1
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
Apr 6 '12 #1
Share this question for a faster answer!
Share on Google+

Post your reply

Sign in to post your reply or Sign up for a free account.