473,385 Members | 1,620 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.

MouseUp/MouseDown events for ASP.NET ImageButton

I want to create a pushbutton-like control on my webform that has an image
on it. I used to think that this is what the ImageButton control was, but it
seems to me that the ImageButton is nothing more than an image that can be
clicked. I have figured out a way to make the ImageButton look like a button
(there was some border property and the backgroud color). However, that
still does not make it look like it is being "pushed" the way other buttons
are. Because all I need to do to change the look between button up/button
down is change the border property, I hoped I could use the
MouseUp/MouseDown events to change this property. But for some reason the
ImageButton control does not have these events. This brings up 2 questions:

1. Why is the control called ImageButton when it does not have the same
properties or look as other types of buttons? I think a more appropriate
name would be something like HyperImage or Image Link, anything that does
not imply it acts and looks like a button.

2. What would be a good way to create the "pushing" effect of a button that
I am trying to get?

Thanks.
--
Nathan Sokalski
nj********@hotmail.com
www.nathansokalski.com
Nov 19 '05 #1
1 5773
You have to use client script and control appearance of the element on the
client. You can't use server code since up/down events do not come to the
server for performance reasons. Alternatively, you can try standard
asp:button and apply image to it using CSS background-image property via
either style or cssclass attribute.

Mikhail Arkhipov (Microsoft)
-- This post is provided 'AS IS' with no warranties and confers no rights

On 2/8/05 21:19, in article uS*************@TK2MSFTNGP15.phx.gbl, "Nathan
Sokalski" <nj********@hotmail.com> wrote:
I want to create a pushbutton-like control on my webform that has an image
on it. I used to think that this is what the ImageButton control was, but it
seems to me that the ImageButton is nothing more than an image that can be
clicked. I have figured out a way to make the ImageButton look like a button
(there was some border property and the backgroud color). However, that
still does not make it look like it is being "pushed" the way other buttons
are. Because all I need to do to change the look between button up/button
down is change the border property, I hoped I could use the
MouseUp/MouseDown events to change this property. But for some reason the
ImageButton control does not have these events. This brings up 2 questions:

1. Why is the control called ImageButton when it does not have the same
properties or look as other types of buttons? I think a more appropriate
name would be something like HyperImage or Image Link, anything that does
not imply it acts and looks like a button.

2. What would be a good way to create the "pushing" effect of a button that
I am trying to get?

Thanks.

Nov 19 '05 #2

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

Similar topics

1
by: Jeremy Robertson | last post by:
I'm working on an application that manages large image files (mulit-page ..Tiff's to be exact some 1000+ pages). I've written an user control that displays a number of the images as thumbnails...
5
by: Tim Bücker | last post by:
Hello. I have a window form with some panels on it. In one panel I am using the OnMouseDown and OnMouseUp events. MouseDown initiates some things and MouseUp releases some things - so it is...
4
by: Colin McGuire | last post by:
Hi again, thanks everyone for your previous help. But having resolved past problems, I'm moving on to new problems :( This one is a simple winforms application with two buttons, named Button1...
1
by: Alan | last post by:
i have a form with a label on it Private Sub Label1_mousedown(ByVal sender As System.Object, ByVal e As System.Windows.Forms.MouseEventArgs) Handles Label1.MouseDown ' do stuff End Sub ...
2
by: dave.wayne | last post by:
In a web page I have a div tag that has a onlick event registered through the event listener. However, that same div tag also has a onmousedown - start a drag and drop script The problem I am...
3
by: Techsatish | last post by:
how to make a mouseup event called only once during a double click event? here double click is made on a tree node in a tree control. I have the code inside mouseup event....in runtime the...
1
by: JDeats | last post by:
It appears the WinForm MouseDown and MouseUp event handlers are not working properly. In the "bare bones" sample application below, Form1_MouseUp gets called even through the mouse button remains...
12
by: Tom Bean | last post by:
I am trying to display a ContextMenuStrip when a user right-clicks on an item in a ListView and have encountered a something that seems strange to me. When the ListView is initially populated,...
2
by: markszlazak | last post by:
In the following script, a control displays (black box) in each table cell once you mouse over the cell. Mouse down on the control to change the mode of the table. Drag the mouse over cells in the...
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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.