Click here to Skip to main content
15,915,702 members
Home / Discussions / C#
   

C#

 
GeneralRe: A question about "bulk" Pin
Garth J Lancaster15-Feb-15 20:21
professionalGarth J Lancaster15-Feb-15 20:21 
QuestionGetting TypeInitializationEcxeption for runing Code: Pin
Member 1144974014-Feb-15 2:41
Member 1144974014-Feb-15 2:41 
AnswerRe: Getting TypeInitializationEcxeption for runing Code: PinPopular
Dave Kreskowiak14-Feb-15 2:47
mveDave Kreskowiak14-Feb-15 2:47 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
OriginalGriff14-Feb-15 4:01
mveOriginalGriff14-Feb-15 4:01 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Dave Kreskowiak14-Feb-15 8:13
mveDave Kreskowiak14-Feb-15 8:13 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Ravi Bhavnani14-Feb-15 16:53
professionalRavi Bhavnani14-Feb-15 16:53 
AnswerRe: Getting TypeInitializationEcxeption for runing Code: Pin
OriginalGriff14-Feb-15 4:01
mveOriginalGriff14-Feb-15 4:01 
AnswerRe: Getting TypeInitializationEcxeption for runing Code: Pin
MortuusI14-Feb-15 6:08
MortuusI14-Feb-15 6:08 
AnswerRe: Getting TypeInitializationEcxeption for runing Code: Pin
Dave Kreskowiak14-Feb-15 8:15
mveDave Kreskowiak14-Feb-15 8:15 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Member 1144974014-Feb-15 8:26
Member 1144974014-Feb-15 8:26 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
OriginalGriff14-Feb-15 9:32
mveOriginalGriff14-Feb-15 9:32 
GeneralRe: Getting TypeInitializationEcxeption for runing Code: Pin
Member 1144974014-Feb-15 8:39
Member 1144974014-Feb-15 8:39 
QuestionHow to install system input language programatically in c# Pin
habib_ashraf14-Feb-15 1:14
habib_ashraf14-Feb-15 1:14 
SuggestionRe: How to install system input language programatically in c# Pin
Richard MacCutchan14-Feb-15 1:51
mveRichard MacCutchan14-Feb-15 1:51 
Question[Solved] Array Issue Pin
Linus Agren14-Feb-15 0:01
Linus Agren14-Feb-15 0:01 
Hey, so I have an issue with my array/code. I want the code to write out YES if the string exists within my array, and write out NO if it doesn't. Problem is that it writes out YES all the time, even if the string does not exist. What am I doing wrong?

C#
string[] kos = new string[] { "test1", "test2", "test3" };
        
private void button2_Click(object sender, EventArgs e)
        {
            for (int i = 0; i <= kos.Count() - 1; i++)
            {
                if (textBox2.Text == kos[i])
                {
                    kosCheckLabel.Text = "YES.";
                    kosCheckLabel.ForeColor = System.Drawing.Color.Red;
                }
                else if(textBox2.Text != kos[i])
                {
                    kosCheckLabel.Text = "NO.";
                    kosCheckLabel.ForeColor = System.Drawing.Color.Lime;
                }
            }
        }


modified 14-Feb-15 8:14am.

GeneralRe: Array Issue Pin
harold aptroot14-Feb-15 0:14
harold aptroot14-Feb-15 0:14 
AnswerRe: Array Issue Pin
OriginalGriff14-Feb-15 0:42
mveOriginalGriff14-Feb-15 0:42 
GeneralRe: Array Issue Pin
Linus Agren14-Feb-15 1:52
Linus Agren14-Feb-15 1:52 
GeneralRe: Array Issue Pin
OriginalGriff14-Feb-15 2:06
mveOriginalGriff14-Feb-15 2:06 
GeneralRe: Array Issue Pin
Linus Agren14-Feb-15 2:13
Linus Agren14-Feb-15 2:13 
GeneralRe: Array Issue Pin
OriginalGriff14-Feb-15 2:19
mveOriginalGriff14-Feb-15 2:19 
GeneralRe: Array Issue Pin
Dave Kreskowiak14-Feb-15 2:44
mveDave Kreskowiak14-Feb-15 2:44 
QuestionCan we implement CSS on a Window Form Pin
Member 1145143613-Feb-15 19:29
Member 1145143613-Feb-15 19:29 
AnswerRe: Can we implement CSS on a Window Form Pin
Richard MacCutchan13-Feb-15 21:35
mveRichard MacCutchan13-Feb-15 21:35 
SuggestionC# WinForms RichTextBox Block-Style Selection Pin
Mr Cirwos13-Feb-15 6:56
Mr Cirwos13-Feb-15 6:56 

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.