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

C#

 
QuestionGetting clock time from NIST Pin
M. J. Jaya Chitra31-May-07 18:12
M. J. Jaya Chitra31-May-07 18:12 
AnswerRe: Getting clock time from NIST Pin
Sathesh Sakthivel31-May-07 18:25
Sathesh Sakthivel31-May-07 18:25 
GeneralRe: Getting clock time from NIST Pin
PIEBALDconsult31-May-07 18:30
mvePIEBALDconsult31-May-07 18:30 
GeneralRe: Getting clock time from NIST Pin
Sathesh Sakthivel31-May-07 18:33
Sathesh Sakthivel31-May-07 18:33 
GeneralRe: Getting clock time from NIST Pin
M. J. Jaya Chitra31-May-07 18:34
M. J. Jaya Chitra31-May-07 18:34 
GeneralRe: Getting clock time from NIST Pin
Sathesh Sakthivel31-May-07 18:38
Sathesh Sakthivel31-May-07 18:38 
GeneralRe: Getting clock time from NIST Pin
M. J. Jaya Chitra31-May-07 19:30
M. J. Jaya Chitra31-May-07 19:30 
QuestionExperiment -- Looking for suggestions Pin
simplicitylabs31-May-07 17:26
simplicitylabs31-May-07 17:26 
While this may not be best practice, it's experimental in my attempts to learn regex while playing around with a RichTextBox.

The idea is to find all HTML tags and color them. However, it's not behaving well. It does indeed find tags such as <html> or </html>, but not <body bgcolor="#ffffff">. I'm relatively sure I have the Regular Expression correct.

Another strange behavior is it won't let me edit the colored tags once they have been "colorized".

I'm triggering this with a key press event (Enter).

At this point, I'm open to suggestions to make this work as prescribed, and of course, I'm prepared to hear alternative suggestions to get the results I'm looking for.

Thank you...

private void ChangeTagColors(RichTextBox richTextBox1)
{
    richTextBox1.SelectionStart = 0;
    richTextBox1.SelectionLength = richTextBox1.Text.Length;
    int index = 0;

    foreach (string str in richTextBox1.Text.Split())
    {
        Regex regex = new Regex(
           @"(\<[^\>]*\>)",
           RegexOptions.IgnoreCase
            | RegexOptions.Multiline
            | RegexOptions.Singleline
            | RegexOptions.ExplicitCapture
            | RegexOptions.Compiled
            );

        if (regex.IsMatch(str))
        {
            richTextBox1.SelectionColor = Color.Blue;
            richTextBox1.SelectionProtected = true;
        }
        index = index + str.Length + 1;
    }
}

AnswerRe: Experiment -- Looking for suggestions Pin
Martin#31-May-07 20:05
Martin#31-May-07 20:05 
QuestionHow to terminate a login session if disconnected from internet Pin
fukchai200031-May-07 16:29
fukchai200031-May-07 16:29 
AnswerRe: How to terminate a login session if disconnected from internet Pin
Dave Kreskowiak31-May-07 17:26
mveDave Kreskowiak31-May-07 17:26 
GeneralRe: How to terminate a login session if disconnected from internet Pin
fukchai200031-May-07 21:42
fukchai200031-May-07 21:42 
GeneralRe: How to terminate a login session if disconnected from internet Pin
Dave Kreskowiak1-Jun-07 4:25
mveDave Kreskowiak1-Jun-07 4:25 
QuestionXML over serial port Pin
sklepikov31-May-07 13:40
sklepikov31-May-07 13:40 
AnswerRe: XML over serial port Pin
Christian Graus31-May-07 13:57
protectorChristian Graus31-May-07 13:57 
GeneralRe: XML over serial port Pin
sklepikov1-Jun-07 3:44
sklepikov1-Jun-07 3:44 
QuestionGive Access to Certificate in Store Pin
mikker_12331-May-07 13:02
mikker_12331-May-07 13:02 
AnswerRe: Give Access to Certificate in Store Pin
blackjack215031-May-07 23:55
blackjack215031-May-07 23:55 
GeneralRe: Give Access to Certificate in Store PinPopular
mikker_1231-Jun-07 0:23
mikker_1231-Jun-07 0:23 
GeneralRe: Give Access to Certificate in Store Pin
DotNet_Naeem2-Sep-09 13:49
DotNet_Naeem2-Sep-09 13:49 
GeneralRe: Give Access to Certificate in Store Pin
SHUBHAM SHARMA6-May-18 19:51
SHUBHAM SHARMA6-May-18 19:51 
Questionhow to access protected-pass folder Pin
alex.almeida31-May-07 12:26
alex.almeida31-May-07 12:26 
AnswerRe: how to access protected-pass folder Pin
mikker_12331-May-07 13:12
mikker_12331-May-07 13:12 
GeneralRe: how to access protected-pass folder Pin
alex.almeida1-Jun-07 2:28
alex.almeida1-Jun-07 2:28 
AnswerRe: how to access protected-pass folder Pin
Dave Kreskowiak31-May-07 13:29
mveDave Kreskowiak31-May-07 13:29 

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.