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

C#

 
GeneralRe: Create a rectangle appear over time on a WinForm C # Pin
quangbinhit27-May-11 4:14
quangbinhit27-May-11 4:14 
AnswerRe: Create a rectangle appear over time on a WinForm C # Pin
Luc Pattyn27-May-11 4:21
sitebuilderLuc Pattyn27-May-11 4:21 
GeneralRe: Create a rectangle appear over time on a WinForm C # Pin
quangbinhit27-May-11 4:30
quangbinhit27-May-11 4:30 
GeneralRe: Create a rectangle appear over time on a WinForm C # Pin
Luc Pattyn27-May-11 7:43
sitebuilderLuc Pattyn27-May-11 7:43 
AnswerRe: Create a rectangle appear over time on a WinForm C # Pin
BobJanova27-May-11 5:05
BobJanova27-May-11 5:05 
GeneralRe: Create a rectangle appear over time on a WinForm C # Pin
quangbinhit27-May-11 16:04
quangbinhit27-May-11 16:04 
GeneralRe: Create a rectangle appear over time on a WinForm C # Pin
BobJanova28-May-11 0:40
BobJanova28-May-11 0:40 
QuestionrichTextBox problem 2 Pin
_Q12_27-May-11 1:38
_Q12_27-May-11 1:38 
This Code is working well but wrong. Wrong because it lower all text -because of the MatchCase method.
How can I make it work without pre-changing anything inside (exception for color text to find)?


int posTxt = 0; 
        private void button2_Click(object sender, EventArgs e)
        {
           
            string searchText = textBox2.Text.ToLower();
            string alltxt = richTextBox1.Text.ToLower();

            if (alltxt.Contains(searchText))
            {
                richTextBox1.Text = alltxt;
                while (posTxt != -1)
                {
                    posTxt = richTextBox1.Find(searchText, posTxt, RichTextBoxFinds.MatchCase);
                    if (richTextBox1.SelectedText == searchText)
                    {
                        richTextBox1.SelectionLength = searchText.Length;
                        richTextBox1.SelectionColor = Color.Red;
                    }
                    posTxt = richTextBox1.Find(searchText, posTxt + 1, RichTextBoxFinds.MatchCase);
                }
            }
            posTxt = 0;
        }

AnswerRe: richTextBox problem 2 Pin
Luc Pattyn27-May-11 1:50
sitebuilderLuc Pattyn27-May-11 1:50 
GeneralRe: richTextBox problem 2 Pin
_Q12_27-May-11 1:59
_Q12_27-May-11 1:59 
AnswerRe: richTextBox problem 2 Pin
Luc Pattyn27-May-11 2:02
sitebuilderLuc Pattyn27-May-11 2:02 
GeneralRe: richTextBox problem 2 Pin
_Q12_27-May-11 2:15
_Q12_27-May-11 2:15 
AnswerRe: richTextBox problem 2 Pin
Luc Pattyn27-May-11 2:35
sitebuilderLuc Pattyn27-May-11 2:35 
GeneralRe: richTextBox problem 2 Pin
_Q12_27-May-11 6:35
_Q12_27-May-11 6:35 
AnswerRe: richTextBox problem 2 Pin
Luc Pattyn27-May-11 6:39
sitebuilderLuc Pattyn27-May-11 6:39 
GeneralRe: richTextBox problem 2 Pin
Dan Mos27-May-11 9:28
Dan Mos27-May-11 9:28 
GeneralRe: richTextBox problem 2 Pin
_Erik_27-May-11 3:25
_Erik_27-May-11 3:25 
GeneralRe: richTextBox problem 2 Pin
_Q12_27-May-11 8:05
_Q12_27-May-11 8:05 
AnswerRe: richTextBox problem 2 Pin
BobJanova27-May-11 5:03
BobJanova27-May-11 5:03 
AnswerRe: richTextBox problem 2 Pin
_Q12_27-May-11 7:59
_Q12_27-May-11 7:59 
QuestionError running sp in C# Pin
MAW3026-May-11 16:31
MAW3026-May-11 16:31 
AnswerRe: Error running sp in C# PinPopular
Richard MacCutchan26-May-11 22:16
mveRichard MacCutchan26-May-11 22:16 
QuestionUserAppDataRegistry - disable ProductVersion component in key path Pin
bob1697226-May-11 15:41
bob1697226-May-11 15:41 
QuestionRegEx for Fist Charactr is Positive Pin
Kevin Marois26-May-11 11:31
professionalKevin Marois26-May-11 11:31 
AnswerRe: RegEx for Fist Charactr is Positive Pin
Luc Pattyn26-May-11 12:00
sitebuilderLuc Pattyn26-May-11 12:00 

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.