Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / February 2008

Tip: Looking for answers? Try searching our database.

Button Color on focus

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
id10t error - 07 Feb 2008 16:29 GMT
Hello,

I am making an ASP.NET page to run on a handheld scanner. The screen
is pretty small and when you use the tab button to move from button it
is hard to tell what button the tab index is on. Is there a way to
change the color of the button when that button was tabbed too?
Manish - 07 Feb 2008 21:04 GMT
Hi,

You can try the following code to set the background color on the textBox
control when the focus is on that control.

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
   <title>Untitled Page</title>
   <script type="text/javascript">
 
   function setColor()
   {
   document.getElementById("Text1").style.backgroundColor = "#00FFFF"
   }
    </script>
</head>
<body>
   <form id="form1" runat="server">
   <div>
       <input id="Text1" style="z-index: 100; left: 47px; position:
absolute; top: 92px"
           type="text" onfocus="setColor()" />
   
   </div>
   </form>
</body>
</html>

Regards,
Manish
www.ComponentOne.com

> Hello,
>
> I am making an ASP.NET page to run on a handheld scanner. The screen
> is pretty small and when you use the tab button to move from button it
> is hard to tell what button the tab index is on. Is there a way to
> change the color of the button when that button was tabbed too?
id10t error - 08 Feb 2008 18:27 GMT
> Hi,
>
[quoted text clipped - 35 lines]
>
> - Show quoted text -

Manish,

Where would I put this code?
Manish - 08 Feb 2008 18:48 GMT
Hi,

You can set the Onfocus event for each control and call the function to
change the color of each control when that control recieves the focus.

Regards,
Manish

www.ComponentOne.com

> > Hi,
> >
[quoted text clipped - 39 lines]
>
> Where would I put this code?

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.