Click here to Skip to main content
15,888,610 members
Home / Discussions / C#
   

C#

 
GeneralRe: Using A Generic Class with a Type Constraint Pin
Richard Andrew x6430-May-17 1:14
professionalRichard Andrew x6430-May-17 1:14 
AnswerRe: Using A Generic Class with a Type Constraint Pin
Gerry Schmitz30-May-17 13:08
mveGerry Schmitz30-May-17 13:08 
GeneralRe: Using A Generic Class with a Type Constraint Pin
Richard Andrew x6430-May-17 14:30
professionalRichard Andrew x6430-May-17 14:30 
QuestionWinform taskbar thumbnail problem Pin
Member 1322816728-May-17 21:37
Member 1322816728-May-17 21:37 
QuestionRe: Winform taskbar thumbnail problem Pin
Maciej Los29-May-17 2:31
mveMaciej Los29-May-17 2:31 
AnswerRe: Winform taskbar thumbnail problem Pin
Dave Kreskowiak29-May-17 2:41
mveDave Kreskowiak29-May-17 2:41 
Questioncalling a string variable in "proc.StartInfo.Arguments" Pin
Member 1322808028-May-17 20:02
Member 1322808028-May-17 20:02 
AnswerRe: calling a string variable in "proc.StartInfo.Arguments" Pin
OriginalGriff28-May-17 20:25
mveOriginalGriff28-May-17 20:25 
When you get an error message like:
the name prnportpatha does not exist inthe current context.
What the compiler is saying is "I looked for something called 'prnportpatha' everywhere that I can, but I can't find it".
Normally there are two reasons for this:
1) You spelled it wrong. Check: C# is case sensitive, so "prnportpatha" is not the same as "prnPortPatha".
2) It's not in scope. This is complicated, but if you declare a variable, you can't use it outside the same set of curly brackets:
C#
if (myCondition)
   {
   string s = "hello";
   Console.WriteLine(s);  // Fine, "s" is in scope"
   }                      // s goes out of scope here
Console.WriteLine(s);     // Error: s is not in scope and can't be found.

This applies to all declarations: fields, properties, methods, events, delegates, ... everything. Once it goes out of scope, you can't access it directly. There are ways to access public (and protected, and internal) items via the class name (for static items, or via an instance (for non-static items) but generally speaking, unless it is in the same scope (or set of curly brackets, basically) you can't access it.

If you can't work it out from that, you need to post the relevant code fragments and we will look at them.
Bad command or file name. Bad, bad command! Sit! Stay! Staaaay...
AntiTwitter: @DalekDave is now a follower!

GeneralRe: calling a string variable in "proc.StartInfo.Arguments" Pin
Member 1322808028-May-17 20:40
Member 1322808028-May-17 20:40 
AnswerRe: calling a string variable in "proc.StartInfo.Arguments" Pin
Ralf Meier28-May-17 21:13
mveRalf Meier28-May-17 21:13 
GeneralRe: calling a string variable in "proc.StartInfo.Arguments" Pin
OriginalGriff28-May-17 21:34
mveOriginalGriff28-May-17 21:34 
GeneralRe: calling a string variable in "proc.StartInfo.Arguments" Pin
Richard MacCutchan28-May-17 21:37
mveRichard MacCutchan28-May-17 21:37 
QuestionDeclaring a Generic Class Pin
Richard Andrew x6428-May-17 14:50
professionalRichard Andrew x6428-May-17 14:50 
AnswerRe: Declaring a Generic Class PinPopular
OriginalGriff28-May-17 19:28
mveOriginalGriff28-May-17 19:28 
GeneralRe: Declaring a Generic Class Pin
Richard Andrew x6429-May-17 2:09
professionalRichard Andrew x6429-May-17 2:09 
GeneralRe: Declaring a Generic Class Pin
OriginalGriff29-May-17 2:26
mveOriginalGriff29-May-17 2:26 
QuestionMessage Closed Pin
28-May-17 9:06
Member 1308759428-May-17 9:06 
AnswerRe: Why still get empty list? Pin
Pete O'Hanlon28-May-17 9:13
mvePete O'Hanlon28-May-17 9:13 
QuestionAbout the WM_LBUTTONDOWN Pin
Member 1322740128-May-17 6:15
Member 1322740128-May-17 6:15 
AnswerRe: About the WM_LBUTTONDOWN Pin
Gerry Schmitz28-May-17 9:51
mveGerry Schmitz28-May-17 9:51 
AnswerRe: About the WM_LBUTTONDOWN Pin
raddevus29-May-17 4:42
mvaraddevus29-May-17 4:42 
QuestionPOST JSON Request to a RESTful service + server deployment Pin
Code_Project_127-May-17 9:07
Code_Project_127-May-17 9:07 
QuestionDislaying 3D model in C# winform Pin
Member 1301708227-May-17 0:11
Member 1301708227-May-17 0:11 
AnswerRe: Dislaying 3D model in C# winform Pin
Dave Kreskowiak27-May-17 4:45
mveDave Kreskowiak27-May-17 4:45 
AnswerRe: Dislaying 3D model in C# winform Pin
lmoelleb28-May-17 2:21
lmoelleb28-May-17 2:21 

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.