First you always have to include the <%@ Import Namespace%= System.Drawing.Color %>
Then you can set the color of the object in ASP.Net.For genrating events you have to specify the (Sender as Object,E as EventArgs) in the subprocedure.
Here is code that will explain you:
<%@ Import Namespace= "System.Drawing.Color" %>
<%@ Page Language="
VB" runat="server" %>
<script language="
vb" runat="server">
Sub ChangeColor(Sender as Object,E as EventArgs)
txtName.BackColor = System.Drawing.Color.Cyan
End Sub
</script>
<html>
<body>
<form runat="server">
<asp:TextBox id="txtName" runat="server"/></br>
<asp:Button id="btn" OnClick=ChangeColor Text = "Change Color" runat="server"/>
</form>
</body>
</html>
Now you just need to know how to catch the focus event.I have tried OnFocus,OnEnter for the TextBox but it didn't work.
Hope this helps...
CEO InteliSoft
Maqsood ur Rahman