[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.drawing

Is there an event for image change for a PictureBox Control? please help.

Jose Michael Meo R. Barrido

12/8/2004 10:15:00 AM

Hi! Can u please tech me a way to know if the image in the picturebox has
changed? what event should i catch the chage?


14 Answers

Bob Powell

12/8/2004 10:38:00 AM

0

There is no event for this.

--
Bob Powell [MVP]
Visual C#, System.Drawing

Find great Windows Forms articles in Windows Forms Tips and Tricks
http://www.bobpowell.net/tips...

Answer those GDI+ questions with the GDI+ FAQ
http://www.bobpowell.net/f...

All new articles provide code in C# and VB.NET.
Subscribe to the RSS feeds provided and never miss a new article.





"Jose Michael Meo R. Barrido" <mike@rdmsinc.net> wrote in message
news:uqEgH5Q3EHA.1076@TK2MSFTNGP09.phx.gbl...
> Hi! Can u please tech me a way to know if the image in the picturebox has
> changed? what event should i catch the chage?
>
>


Cor Ligthert [MVP]

12/8/2004 10:46:00 AM

0

Jose,

> Hi! Can u please tech me a way to know if the image in the picturebox has
> changed? what event should i catch the chage?

By what (how) is the change done?

Cor


(Herfried K. Wagner [MVP])

12/8/2004 11:00:00 AM

0

"Jose Michael Meo R. Barrido" <mike@rdmsinc.net> schrieb:
> Hi! Can u please tech me a way to know if the image in the picturebox has
> changed? what event should i catch the chage?

As the developer you should know yourself when you change the image ;-). In
other words: No, there is no such event.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvp...
V B <URL:http://dotnet.mvps.org/dotnet...

Cor Ligthert [MVP]

12/8/2004 11:06:00 AM

0

Hefried,

> As the developer you should know yourself when you change the image ;-).
> In other words: No, there is no such event.

Again, please do not answer questions which I ask to an OP, wherefore
probably (not always for sure) the answer is obvious.

Cor


(Herfried K. Wagner [MVP])

12/8/2004 11:14:00 AM

0

"Cor Ligthert" <notmyfirstname@planet.nl> schrieb:
>> As the developer you should know yourself when you change the image ;-).
>> In other words: No, there is no such event.
>
> Again, please do not answer questions which I ask to an OP, wherefore
> probably (not always for sure) the answer is obvious.

Huh?!

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvp...
V B <URL:http://dotnet.mvps.org/dotnet...

Supra

12/9/2004 11:48:00 AM

0

me 2 ;-)

Herfried K. Wagner [MVP] wrote:

> "Cor Ligthert" <notmyfirstname@planet.nl> schrieb:
>
>>> As the developer you should know yourself when you change the image
>>> ;-). In other words: No, there is no such event.
>>
>>
>> Again, please do not answer questions which I ask to an OP, wherefore
>> probably (not always for sure) the answer is obvious.
>
>
> Huh?!
>

Cor Ligthert [MVP]

12/9/2004 1:19:00 PM

0

> 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


(Herfried K. Wagner [MVP])

12/9/2004 8:09:00 PM

0

"Cor Ligthert" <notmyfirstname@planet.nl> schrieb:
> When than somebody else give in a (in my opinion kind of rude way) that
> answer I am not happy.

My reply was /not/ rude. Period.

--
M S Herfried K. Wagner
M V P <URL:http://dotnet.mvp...
V B <URL:http://dotnet.mvps.org/dotnet...

AviD

12/10/2004 8:07:00 PM

0

I would like to help. Indeed the PictureBox control has no event associated
with the change of an image. But I can see no problem in creating your own
picturebox control, inheriting from the system PictureBox. In your control
you may add your own event capturing an image change. This is only a
suggestion, I have no code,
I'll try it myself.


"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
>
>
>

AviD

12/10/2004 9:19:00 PM

0

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