473,385 Members | 2,003 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Q: How to eliminate selection rectangle on ImageButton?

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
10 2036
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
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
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
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
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
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
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

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
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
WOOHOO!!!

That worked beautifully!!

THANK YOU!

Nov 19 '05 #11

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Philippe Meunier | last post by:
Hi, I would like to know How I could draw a Dashed rectangle over everything in a container. I will use this to draw a selection rectangle (like in VB.NET Form Designer UI). And even it draws in...
5
by: (Pete Cresswell) | last post by:
I've got a TreeView on the left of my screen. As the user navigates the tree, I load corresonding detail info into the rest of the screen. Works ok, but when the user clicks on a detail field,...
2
by: (Pete Cresswell) | last post by:
Seems like I've been here before, but can't find anyting in Google. I've got two list boxes on a form. Seems to me like the inactive ListBox's selection rectangle should be something like...
3
by: Jeroen Ceuppens | last post by:
I need a selection tracker on a graphic Idea: left click: rectangle appear en grows when you move the mouse, again clicking is lock te rectangle How do you do that? Greetz Jeroen
5
by: Lie | last post by:
Hi all, I have problem in getting selectedindex of multiple listbox selection in a datagrid. I have a listbox with multiple selection mode inside datagrid. In Edit mode, I need to get back all...
0
by: Brian Henry | last post by:
I am trying to do a owner drawn list view in detail mode, when i inherited the list view into a new custom control then turned on double buffering all the sudden the selection rectangle is the...
11
by: thom | last post by:
Hello everybody, Here is a little javascript that gives me the mouse's x and y coordinates. Now, i'd like to be able to make selection(s) rectangle(s) on a given image with it. And then,...
0
by: sharonrao123 | last post by:
hello all, I have a parent gridview company and in this one a nested gridview people, Is it possible to allow the user to select one row or multiple rows from the people gridview using a check box...
5
by: Jure Bogataj | last post by:
Hi all! I have a problem (performance issue) with listview. I have implemented an ItemSelectionChange on my listview and put some code in it (I build some toolbar based on selection and update...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.