vis781
Well-known member
Hi there, i'll try to explain this as simply as possible.
I have a public property in my user control tha allows the user to adjust the opacity of a color. It is adjusted by altering the alpha channel. However if i get a daft user and he/she tries to set it at less that one or more than 255 the application throws a wobbly despite any error handling that i place in there. Can any one help as to where i should place my error handling so the error is delt with by my code. My code it as follows:
[Public property GradientOpacity as Integer
Get
Return some variable
End Get
Try
Set (ByVal value as Integer)
some variable = value
Catch ex as exception
Throw new ArgumentOutOfRangeException
End Set
End Try
If you can help i would appreciate it. Thanks
I have a public property in my user control tha allows the user to adjust the opacity of a color. It is adjusted by altering the alpha channel. However if i get a daft user and he/she tries to set it at less that one or more than 255 the application throws a wobbly despite any error handling that i place in there. Can any one help as to where i should place my error handling so the error is delt with by my code. My code it as follows:
[Public property GradientOpacity as Integer
Get
Return some variable
End Get
Try
Set (ByVal value as Integer)
some variable = value
Catch ex as exception
Throw new ArgumentOutOfRangeException
End Set
End Try
If you can help i would appreciate it. Thanks