TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
latika singh
NA
31
33.5k
Setting property values
Nov 2 2011 6:03 PM
Dear All,
I have a property that returns a private variable. Inside my Set loop I have created the following if condition:
Try
If value >= 0 And value <= 1000 Then
m_var = value
End If
Catch ex As Exception
MsgBox("Value out of range [0 -- 1000]")
End Try
Now it will catch an exception if the value is out of range 0 -- 1000. But how do I setup the value in a way that if the user enters 30 it should not accept this value; instead these values should be a multiple of 20. So as soon as I enter 30 it should change it to 20. If I enter 50 then it should revert it to 40. I am not sure if we would have to use a step command and loop through values between 0 -- 1000 everytime code enters into this property.
Please suggest.
Reply
Answers (
1
)
How to call event delegates from another project in c#/winforms?
C# checking if a row in a datagridview is selected