Solved

How to NOT display "little hand" of mouse when image button is disabled?

Posted on 2004-08-25
3
283 Views
Last Modified: 2011-10-03
I wouldn't want to display the "little hand" of the mouse when my image button is disabled. Does any one know how to do that?

MyImageButton.Enabled = False

Then how to not display the little hand of the mouse?
Thanks!
0
Comment
Question by:CrazyNet
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Expert Comment

by:alexpreston
ID: 11900227
Try   MyImageButton.style = "cursor: default"
0
 
LVL 3

Expert Comment

by:alexpreston
ID: 11900240
ooh, .NET.

Try this instead   MyImageButton.Attributes.Add("style", "cursor:default")
0
 
LVL 8

Accepted Solution

by:
shovavnik earned 150 total points
ID: 11900536
Don't use the second one, as you'll overwrite the existing style information.

Instead use the special style property:

MyImageButton.Style.Add("cursor", "default")

But the best way is to not do this in the codebehind.  Rather, it's much better to manage style informationon the client.  
Use one of the following methods:
1. Add it to the style attribute of the control.
2. Add a css class for images either in a linked css file or in a <styles> element on your page:
img {
  cursor: default;
}

The reason to do this on the client side, is that it makes it much easier to maintain.  You want to avoid needing to recompile your code just to change style information.  CodeBehind isn't good for *everything*.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In an ASP.NET application, I faced some technical problems. In this article, I list them out and show the solutions that I found.  I hope it will be useful. Problem: After closing a pop-up window, the parent page should be refreshed automaticall…
IntroductionWhile developing web applications, a single page might contain many regions and each region might contain many number of controls with the capability to perform  postback. Many times you might need to perform some action on an ASP.NET po…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

735 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question