By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,851 Members | 1,131 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,851 IT Pros & Developers. It's quick & easy.

Q: How to eliminate selection rectangle on ImageButton?

P: n/a
I don't know if this can even be done, but I'd REALLY like to eliminate
the selection rectangle that appears around my ImageButton controls
when the user clicks on them. The buttons are on a black background,
and the selection rectangle looks like complete crap.
Any suggestions are greatly appreciated!!

Thanks!

Nov 19 '05 #1
Share this Question
Share on Google+
10 Replies


P: n/a
On 26 Jan 2005 09:32:31 -0800, "Tyrant Mikey"
<mi***********@civigenics.com> wrote:
I don't know if this can even be done, but I'd REALLY like to eliminate
the selection rectangle that appears around my ImageButton controls
when the user clicks on them. The buttons are on a black background,
and the selection rectangle looks like complete crap.
Any suggestions are greatly appreciated!!

Thanks!


Do you have a URL example to look at?

I

--
Iain Norman | http://www.eliteforum.org
Nov 19 '05 #2

P: n/a
No, I don't have a sample, really. What I've got, though is pretty
straightforward.

I have an ASP.NET page. There's an ImageButton control on it, with a
Windows bitmap loaded into it (the images contain text, and they look
much better as BMPs then JPGs or GIFs). The images are are rounded
buttons, set against a black background. The page looks great, right up
until the user clicks on the button. At that point, the focus rectangle
appears on the control, and ruins the visual consistency of my page (a
white dotted rectangle forms around a capsule-shaped button).

What I'd like to do is hide the selection/focus rectangle on the image
buttons if possible.

If it can't be done, I'll just have to accept that. But it sure would
be nice to be able to get rid of it.

Nov 19 '05 #3

P: n/a
Actually I just uploaded a snapshot of the problem:
http://img.photobucket.com/albums/v3...srectangle.bmp

The snapshot is only a small portion of the screen due to the NDA.
However, it clearly shows an image button with a garish focus rectangle
around it. I'd REALLY like to eliminate the focus rectangle.

Thanks!

Nov 19 '05 #4

P: n/a
That looks like something the browser puts on the screen when the control
has the focus.

"Tyrant Mikey" <mi***********@civigenics.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Actually I just uploaded a snapshot of the problem:
http://img.photobucket.com/albums/v3...srectangle.bmp

The snapshot is only a small portion of the screen due to the NDA.
However, it clearly shows an image button with a garish focus rectangle
around it. I'd REALLY like to eliminate the focus rectangle.

Thanks!


Nov 19 '05 #5

P: n/a
If there is a way to suppress the focus, it will most likely be part of CSS.
I'd hunt there first, especially the IE-specific CSS documentation as there
may be a custom attribute for this.

Meanwhile, while googling on "disable focus rectangle css", I stumbled
across this;
http://www.faqts.com/knowledge_base/...id/5693/fid/53
It seems to be a javascript approach to your problem.

Also see;
http://nowhere.2entwine.com/archives/000127.html
http://www.webdesignforums.net/archi...hp/t-4728.html
http://www.projectseven.com/extensions/info/remscrub/

/// M
"Tyrant Mikey" <mi***********@civigenics.com> wrote in message
news:11**********************@f14g2000cwb.googlegr oups.com...
Actually I just uploaded a snapshot of the problem:
http://img.photobucket.com/albums/v3...srectangle.bmp

The snapshot is only a small portion of the screen due to the NDA.
However, it clearly shows an image button with a garish focus rectangle
around it. I'd REALLY like to eliminate the focus rectangle.

Thanks!

Nov 19 '05 #6

P: n/a
On 26 Jan 2005 10:09:02 -0800, "Tyrant Mikey"
<mi***********@civigenics.com> wrote:
Actually I just uploaded a snapshot of the problem:
http://img.photobucket.com/albums/v3...srectangle.bmp

The snapshot is only a small portion of the screen due to the NDA.
However, it clearly shows an image button with a garish focus rectangle
around it. I'd REALLY like to eliminate the focus rectangle.

Thanks!


I'd be interested to see the relevant snippet of rendered HTML from
the browsers View Sourcey whotsit.
--
Iain Norman | http://www.eliteforum.org
Nov 19 '05 #7

P: n/a
Oila!!

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<!-- SNIPPED! -->
</HEAD>
<BODY ms_positioning="GridLayout">
<!-- Smart Navigation and ViewState snipped! -->
<form name="Form1" method="post" action="defaultpage.aspx" id="Form1"
__smartNavEnabled="true">
<!-- Smart Navigation and ViewState snipped! -->
<!-- Other webcontrols on the page snipped! -->
<input type="image" name="btnProceed" id="btnProceed"
src="images/button_proceed.bmp" alt="" border="0" style="Z-INDEX: 106;
LEFT: 336px; POSITION: absolute; TOP: 472px" />
</form>
</BODY>
</HTML>

Nov 19 '05 #8

P: n/a

Tyrant Mikey wrote:
*I don't know if this can even be done, but I'd REALLY like to
eliminate
the selection rectangle that appears around my ImageButton controls
when the user clicks on them. The buttons are on a black background,
and the selection rectangle looks like complete crap.
Any suggestions are greatly appreciated!!

Thanks! *


Hey Tyrant,
Have you found a fix for this yet. I strugled with the same thing for a
couple of hours before I tried this.

MyImageButton.Attributes.Add("onFocus", "this.blur();")

I have this in the page load event of my vb code behind page, works
great!
Good Luck
Alan

--
alanl2
------------------------------------------------------------------------
Posted via http://www.codecomments.com
------------------------------------------------------------------------

Nov 19 '05 #9

P: n/a
Nope, I hadn't found a fix for it yet. But I will give this a try. I
wonder if it interferes with the postback...

Thanks for the tip!

Nov 19 '05 #10

P: n/a
WOOHOO!!!

That worked beautifully!!

THANK YOU!

Nov 19 '05 #11

This discussion thread is closed

Replies have been disabled for this discussion.