Solved

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

Posted on 2004-08-25
3
279 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
  • 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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

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…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now