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

C#

 
QuestionCorrect Syntax; No Result? Pin
Zachery Hysong17-Jun-14 7:50
Zachery Hysong17-Jun-14 7:50 
AnswerRe: Correct Syntax; No Result? Pin
Eddy Vluggen17-Jun-14 8:05
professionalEddy Vluggen17-Jun-14 8:05 
GeneralRe: Correct Syntax; No Result? Pin
Zachery Hysong17-Jun-14 8:22
Zachery Hysong17-Jun-14 8:22 
GeneralRe: Correct Syntax; No Result? Pin
Eddy Vluggen17-Jun-14 8:50
professionalEddy Vluggen17-Jun-14 8:50 
AnswerRe: Correct Syntax; No Result? Pin
OriginalGriff17-Jun-14 8:21
mveOriginalGriff17-Jun-14 8:21 
GeneralRe: Correct Syntax; No Result? Pin
Zachery Hysong17-Jun-14 8:23
Zachery Hysong17-Jun-14 8:23 
GeneralRe: Correct Syntax; No Result? Pin
OriginalGriff17-Jun-14 8:29
mveOriginalGriff17-Jun-14 8:29 
AnswerRe: Correct Syntax; No Result? Pin
Richard Deeming17-Jun-14 8:26
mveRichard Deeming17-Jun-14 8:26 
You're passing the parameter by value, which means that any changes you make to the parameter within the method will be discarded when the method returns. I suspect you meant to pass it by reference, so that the changes would be copied back.

Passing Parameters (C# Programming Guide)[^]

In this case, since you're not using the value of the parameter within the method, and you're always assigning a value to it before the method returns, you should declare it as an out parameter.

C#
public void optionCheck(TextBox txt, out string str)
{
    if (txt.Text == "0")
    {
        str = "+++";
    }
    else
    {
        str = "---";
    }
}

optionCheck(txtDoorsSafety1, out strDoorsOption1);




"These people looked deep within my soul and assigned me a number based on the order in which I joined."
- Homer


QuestionHow do I get a list of all windows user groups Pin
sneezesnoeze16-Jun-14 22:48
sneezesnoeze16-Jun-14 22:48 
AnswerRe: How do I get a list of all windows user groups Pin
Eddy Vluggen17-Jun-14 3:03
professionalEddy Vluggen17-Jun-14 3:03 
GeneralRe: How do I get a list of all windows user groups Pin
sneezesnoeze17-Jun-14 8:02
sneezesnoeze17-Jun-14 8:02 
GeneralRe: How do I get a list of all windows user groups Pin
Eddy Vluggen17-Jun-14 8:08
professionalEddy Vluggen17-Jun-14 8:08 
GeneralRe: How do I get a list of all windows user groups Pin
sneezesnoeze17-Jun-14 10:59
sneezesnoeze17-Jun-14 10:59 
GeneralRe: How do I get a list of all windows user groups Pin
Eddy Vluggen17-Jun-14 11:09
professionalEddy Vluggen17-Jun-14 11:09 
GeneralRe: How do I get a list of all windows user groups Pin
Pete O'Hanlon17-Jun-14 11:47
mvePete O'Hanlon17-Jun-14 11:47 
AnswerRe: How do I get a list of all windows user groups Pin
Yonatan Arbel20-Jun-14 2:51
Yonatan Arbel20-Jun-14 2:51 
AnswerRe: How do I get a list of all windows user groups Pin
Nathan Minier20-Jun-14 3:08
professionalNathan Minier20-Jun-14 3:08 
QuestionC# Windows Forms App Pin
Zeyad Jalil16-Jun-14 19:33
professionalZeyad Jalil16-Jun-14 19:33 
AnswerRe: C# Windows Forms App Pin
Eddy Vluggen17-Jun-14 7:15
professionalEddy Vluggen17-Jun-14 7:15 
AnswerRe: C# Windows Forms App Pin
Swinkaran17-Jun-14 13:39
professionalSwinkaran17-Jun-14 13:39 
Question[Wp8.1] How to save the RenderTargetBitmap to png? Pin
Lãng Khách15-Jun-14 23:08
Lãng Khách15-Jun-14 23:08 
AnswerRe: [Wp8.1] How to save the RenderTargetBitmap to png? Pin
BobJanova16-Jun-14 0:34
BobJanova16-Jun-14 0:34 
GeneralRe: [Wp8.1] How to save the RenderTargetBitmap to png? Pin
Lãng Khách16-Jun-14 1:17
Lãng Khách16-Jun-14 1:17 
Questionc# - duplicate tabpage Pin
Member 1026763014-Jun-14 22:46
Member 1026763014-Jun-14 22:46 
AnswerRe: c# - duplicate tabpage Pin
OriginalGriff14-Jun-14 23:40
mveOriginalGriff14-Jun-14 23:40 

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.