Click here to Skip to main content
15,918,168 members
Home / Discussions / C#
   

C#

 
GeneralRe: Working with Crystal Reports and Forms Pin
Saksida Bojan9-Jan-10 3:11
Saksida Bojan9-Jan-10 3:11 
QuestionHow to retrieve username from event Log in C#? Pin
Sunil G8-Jan-10 19:10
Sunil G8-Jan-10 19:10 
AnswerRe: How to retrieve username from event Log in C#? Pin
Eddy Vluggen9-Jan-10 1:20
professionalEddy Vluggen9-Jan-10 1:20 
QuestionForm With Shadow Pin
roshihans8-Jan-10 16:35
roshihans8-Jan-10 16:35 
AnswerRe: Form With Shadow Pin
Saksida Bojan8-Jan-10 19:06
Saksida Bojan8-Jan-10 19:06 
GeneralRe: Form With Shadow Pin
roshihans8-Jan-10 19:59
roshihans8-Jan-10 19:59 
GeneralRe: Form With Shadow Pin
Saksida Bojan8-Jan-10 20:21
Saksida Bojan8-Jan-10 20:21 
GeneralRe: Form With Shadow Pin
roshihans8-Jan-10 22:42
roshihans8-Jan-10 22:42 
GeneralRe: Form With Shadow Pin
Saksida Bojan8-Jan-10 22:46
Saksida Bojan8-Jan-10 22:46 
GeneralRe: Form With Shadow Pin
roshihans9-Jan-10 1:43
roshihans9-Jan-10 1:43 
GeneralRe: Form With Shadow Pin
Saksida Bojan9-Jan-10 1:58
Saksida Bojan9-Jan-10 1:58 
GeneralRe: Form With Shadow Pin
roshihans9-Jan-10 5:00
roshihans9-Jan-10 5:00 
GeneralRe: Form With Shadow Pin
roshihans9-Jan-10 16:04
roshihans9-Jan-10 16:04 
GeneralRe: Form With Shadow Pin
Saksida Bojan9-Jan-10 22:12
Saksida Bojan9-Jan-10 22:12 
AnswerRe: Form With Shadow Pin
So Sereyboth29-Mar-11 23:16
So Sereyboth29-Mar-11 23:16 
QuestionI have another problem :( [modified] Pin
Raztor08-Jan-10 16:30
Raztor08-Jan-10 16:30 
AnswerRe: I have another problem :( Pin
Luc Pattyn8-Jan-10 16:50
sitebuilderLuc Pattyn8-Jan-10 16:50 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:05
Raztor08-Jan-10 17:05 
AnswerRe: I have another problem :( Pin
Abhinav S8-Jan-10 16:55
Abhinav S8-Jan-10 16:55 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:04
Raztor08-Jan-10 17:04 
GeneralRe: I have another problem :( Pin
Abhinav S8-Jan-10 17:09
Abhinav S8-Jan-10 17:09 
GeneralRe: I have another problem :( Pin
Luc Pattyn8-Jan-10 17:14
sitebuilderLuc Pattyn8-Jan-10 17:14 
GeneralRe: I have another problem :( Pin
Raztor08-Jan-10 17:20
Raztor08-Jan-10 17:20 
GeneralRe: I have another problem :( Pin
DaveyM698-Jan-10 23:20
professionalDaveyM698-Jan-10 23:20 
Raztor0 wrote:
solving it by adding static is a good solution


That depends on the purpose of rollcount.

If it's counting the number of ALL rolls in the game, then static is fine as it's not directly related to an instance of the class. If the class had proper names that would belong to a Dice class. It would be better to have a public static (readonly) property with a private static field. Even in this situation, it may be better to have a Game class and the value would be an instance member of that.

If it's counting the number of throws per player then it would need to be an instance member - of a Player class, this class should raise an event to tell the main form (or any other interested party) that the value has changed.

It's really quite easy to do and worth doing properly. Once you've done it the correct way once, you'll never take the nasty 'static' approach again unless it's the correct solution.

If you want further help you'll need to post some relavent code snippets as so far we are just guessing!

Dave

BTW, in software, hope and pray is not a viable strategy. (Luc Pattyn)
Why are you using VB6? Do you hate yourself? (Christian Graus)

GeneralRe: I have another problem :( [modified] Pin
Raztor09-Jan-10 4:12
Raztor09-Jan-10 4:12 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.