Click here to Skip to main content
15,887,775 members
Home / Discussions / C#
   

C#

 
AnswerRe: Problem serializing object to XML Pin
Henry Minute8-Oct-09 11:36
Henry Minute8-Oct-09 11:36 
QuestionHelp with Constants Pin
yogi_bear_798-Oct-09 8:07
yogi_bear_798-Oct-09 8:07 
AnswerRe: Help with Constants Pin
Ennis Ray Lynch, Jr.8-Oct-09 8:09
Ennis Ray Lynch, Jr.8-Oct-09 8:09 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 8:28
yogi_bear_798-Oct-09 8:28 
AnswerRe: Help with Constants Pin
Richard MacCutchan8-Oct-09 8:37
mveRichard MacCutchan8-Oct-09 8:37 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 8:55
yogi_bear_798-Oct-09 8:55 
GeneralRe: Help with Constants Pin
Richard MacCutchan8-Oct-09 22:02
mveRichard MacCutchan8-Oct-09 22:02 
AnswerRe: Help with Constants Pin
harold aptroot8-Oct-09 8:41
harold aptroot8-Oct-09 8:41 
That's not really the "right" error you know, it should say "Syntax error: this is C#, not VB"

Blind suggestion (untested)
namespace VDP
{
   public class GlobalVar
   {
      public const string DIAMONDS = "♦";
   }
}

namespace VDP
{
   public partial class frmMain : Form
   {
      //snippet
      switch (x)
      {
         case globalVar.DIAMONDS:
            break;
      }
   }
}

Hint: the right side of a case should be an actual constant, not a "thing that is logically constant", but syntactically constant.

Good luck



GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 9:03
yogi_bear_798-Oct-09 9:03 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 10:09
yogi_bear_798-Oct-09 10:09 
GeneralRe: Help with Constants Pin
harold aptroot8-Oct-09 10:58
harold aptroot8-Oct-09 10:58 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 12:31
yogi_bear_798-Oct-09 12:31 
GeneralRe: Help with Constants Pin
harold aptroot8-Oct-09 12:34
harold aptroot8-Oct-09 12:34 
AnswerRe: Help with Constants Pin
Md. Marufuzzaman8-Oct-09 9:26
professionalMd. Marufuzzaman8-Oct-09 9:26 
AnswerRe: Help with Constants Pin
Luc Pattyn8-Oct-09 9:29
sitebuilderLuc Pattyn8-Oct-09 9:29 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 9:42
yogi_bear_798-Oct-09 9:42 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 9:55
yogi_bear_798-Oct-09 9:55 
AnswerRe: Help with Constants Pin
Christian Graus8-Oct-09 9:31
protectorChristian Graus8-Oct-09 9:31 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 9:33
yogi_bear_798-Oct-09 9:33 
GeneralRe: Help with Constants Pin
Christian Graus8-Oct-09 9:49
protectorChristian Graus8-Oct-09 9:49 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 9:53
yogi_bear_798-Oct-09 9:53 
GeneralRe: Help with Constants Pin
Christian Graus8-Oct-09 10:13
protectorChristian Graus8-Oct-09 10:13 
GeneralRe: Help with Constants Pin
yogi_bear_798-Oct-09 12:35
yogi_bear_798-Oct-09 12:35 
AnswerRe: Help with Constants Pin
PIEBALDconsult8-Oct-09 10:48
mvePIEBALDconsult8-Oct-09 10:48 
GeneralRe: Help with Constants Pin
Luc Pattyn8-Oct-09 10:53
sitebuilderLuc Pattyn8-Oct-09 10:53 

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.