ImageButton

  • Thread starter Thread starter J
  • Start date Start date
J

J

I have to images for my image buttons. One image has a border around
it(background) and the other doesn' t. What I would like to do is when
the user clicks the button swap out the images on the mouse down click
and when the mouse is released put the original image back. How can I
do this?

Thanks
 
Here's some similar code for an ImageButton Rollover control.

Imports System.ComponentModel

Imports System.Web.UI



<Editor(GetType(System.Web.UI.Design.ImageUrlEditor), GetType(System.Drawing.Design.UITypeEditor))> _

Public Class aciImageRollover

Inherits System.Web.UI.WebControls.ImageButton



Dim _sRolloverURL As String



<Editor(GetType(System.Web.UI.Design.ImageUrlEditor), GetType(System.Drawing.Design.UITypeEditor))> Property RolloverImageURL() As String

Get

Return _sRolloverURL

End Get

Set(ByVal Value As String)

_sRolloverURL = Value

Me.Attributes.Add("onMouseOver", "this.src='" & _sRolloverURL & "'")

Me.Attributes.Add("onMouseOut", "this.src='" & Me.ImageUrl & "'")

End Set

End Property

End Class
 
Do you know of any way to do the same thing but without specifying an URL, something like using a bitmap in memory

Thanks
 
However, the url could point to an aspx page that generated an image
on-the-fly, or from memory on the server.

-Jason
 
Jason

The ASPX solution I already did, but it is kind of slow. What do you mean with "from memory on the server"

Thanks for your help
Damian.
 
I was just referring to your original post. If you had an image "in
memory" that you had drawn/loaded/whatever, you could return it through
an aspx page. The image still has to get downloaded to the client somehow.

-Jason
 
Back
Top