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" %>
Sub ChangeColor(Sender as Object,E as EventArgs)
txtName.BackColor = System.Drawing.Color.Cyan
<asp:TextBox id="txtName" runat="server"/></br>
<asp:Button id="btn" OnClick=ChangeColor Text = "Change Color" runat="server"/>
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...
Maqsood ur Rahman