RGB code

N

nemo

Hi, I want to find out the RGB code of the default background color of
any window created in VS.Net. The properties panel shows the name of
the color as "control" but does not display the RGB code. Can someone
pls. help.

thanks
Nemo
 
K

Ken Cox - Microsoft MVP

Hi Nemo,

I'm not exactly sure of your question but keep in mind that unless you set a
background colour, the browser will use its default. The default colour the
browser chooses probably comes from the operating system. Although it is
normally white.

Here's some client-side code that shows how to set and get the background
colour.

<%@ page language="VB" trace="true" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body bgcolor="blue">

<script>
document.write(document.body.bgColor);
</script>

<form id="form1" runat="server">
<div>
</div>
</form>
</body>
</html>


Ken
Microsoft MVP [ASP.NET]
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
474,432
Messages
2,571,680
Members
48,796
Latest member
Greg L.

Latest Threads

Top