You code it exactly like you have written it
If you need to call it from a button, then in your button click handler you merely call the function and update the value wherever you need to (i.e. a textfield or whatever).
C# doesn't have "procedures" - only functions. Functions that do not return a value are declared as returning "void", like so
public void someFunction(){
}
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 838
Posting Genius
Offline 6,761 posts
since May 2007