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

C#

 
AnswerRe: C# FOR Loop Speed Issue Pin
V.19-Jun-14 4:13
professionalV.19-Jun-14 4:13 
QuestionFields in TFS WorkItem not able to change values Pin
hanusri18-Jun-14 7:20
hanusri18-Jun-14 7:20 
QuestionTCP connection to specific client Pin
kruegs3518-Jun-14 4:49
kruegs3518-Jun-14 4:49 
AnswerRe: TCP connection to specific client Pin
Eddy Vluggen18-Jun-14 5:15
professionalEddy Vluggen18-Jun-14 5:15 
GeneralRe: TCP connection to specific client Pin
kruegs3518-Jun-14 5:57
kruegs3518-Jun-14 5:57 
AnswerRe: TCP connection to specific client Pin
ZurdoDev18-Jun-14 8:29
professionalZurdoDev18-Jun-14 8:29 
AnswerRe: TCP connection to specific client Pin
jschell18-Jun-14 11:15
jschell18-Jun-14 11:15 
QuestionCorrect Syntax; No Result? Pin
Zachery Hysong17-Jun-14 7:50
Zachery Hysong17-Jun-14 7:50 
Hey guys, I have a strange problem. I am trying to write a function that looks at a TextBox that, if it is equal to a certain value, changes the value of a string to something else.
Here is my code:

I define the string in Main:
C#
string strDoorsOption1 = "test";

The Method is defined as:
C#
public void optionCheck(TextBox txt, string str)
{
    if (txt.Text == "0")
    {
        str = "+++";
    }
    else
    {
        str = "---";
    }
}

I call the Method like this:
C#
private void chkDoorsSafetyLaminated_CheckedChanged(object sender, EventArgs e)
{
    checkBoxClick3(chkDoorsSafetyLaminated, txtDoorsSafety1);

    optionCheck(txtDoorsSafety1, strDoorsOption1);
}


checkBoxClick3 is another Method that works as intended to change the value of a TextBox.
For reference, it is defined as follows:
C#
public void checkBoxClick3(CheckBox check, TextBox txt)
{
    /* Determine the CheckState of the Checkbox */
    if (check.CheckState == CheckState.Checked)
    {
        /* If the CheckState is Checked, then set the value to 1 */
        txt.Text = "1";
    }
    else
    {
        /* If the CheckState is Unchecked or Inditerminate, then set the value to 0 */
        txt.Text = "0";
    }
}


This works...:
C#
if (txtDoorsSafety1.Text == "0")
{
    strDoorsOption1 = "+++";
}
else
{
    strDoorsOption1 = "---";
}


But when I call optionCheck(txtDoorsSafety1, strDoorsOption1); it acts as if the method is empty. It completely compiles with no errors or warnings, it simply does nothing.

Any help would be appreciated.
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 
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 

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.