AviD
12/10/2004 9:19:00 PM
hi, try this one:
Imports System
Imports System.Windows.Forms
Imports System.Drawing.Drawing2D
Imports System.Drawing
<ToolboxBitmap(GetType(PictureBox))> _
Public Class adxPictureControl
Inherits PictureBox
Private _image As System.Drawing.Image
Event ImageBeforeChanged(ByVal sender As Object, ByVal e As
EventArgsImageChanged)
Event ImageAfterChanged(ByVal sender As Object, ByVal e As
EventArgsImageChanged)
Public Shadows Property Image() As Image
Get
Return _image
End Get
Set(ByVal Value As Image)
If Not Value Is _image Then
If Me.DesignMode Then
MyBase.Image = Value
_image = Value
Else
Dim ea As New EventArgsImageChanged
If Not _image Is Nothing Then
RaiseEvent ImageBeforeChanged(Me, ea)
If ea.Cancel = True Then
Exit Property
End If
End If
MyBase.Image = Value
_image = Value
RaiseEvent ImageAfterChanged(Me, ea)
End If
End If
End Set
End Property
End Class
Public Class EventArgsImageChanged
Inherits EventArgs
Private _cancel As Boolean = False
Public Property Cancel() As Boolean
Get
Return _cancel
End Get
Set(ByVal Value As Boolean)
_cancel = Value
End Set
End Property
End Class
"Cor Ligthert" wrote:
> > me 2 ;-)
> >
> Has to do with politness, I am sorry that you did not understand it.
>
> When the OP ask something what is for you strange because the answer is
> obvious, than you can give an answer, however you can as well do what I did
> and ask what he means with his question, although you know almost for sure
> your answer.
>
> When than somebody else give in a (in my opinion kind of rude way) that
> answer I am not happy.
> In that way the OP will probably never ask a question here again.
>
> I can than write nothing or ask to do it not again the next time.
>
> Clear?
>
> Cor
>
>
>