Click here to Skip to main content
15,902,809 members
Home / Discussions / C#
   

C#

 
GeneralRe: Catch Specific exception in SqlClient Pin
Skanless5-Dec-07 22:34
Skanless5-Dec-07 22:34 
GeneralRe: Catch Specific exception in SqlClient Pin
PIEBALDconsult7-Dec-07 12:36
mvePIEBALDconsult7-Dec-07 12:36 
QuestionPerformance in PictureBox playing an animated Gif Pin
RodiGarcia5-Dec-07 12:22
RodiGarcia5-Dec-07 12:22 
GeneralRe: Performance in PictureBox playing an animated Gif Pin
Christian Graus5-Dec-07 13:08
protectorChristian Graus5-Dec-07 13:08 
Questionhow to write code to download file Pin
uowzd015-Dec-07 12:05
uowzd015-Dec-07 12:05 
GeneralRe: how to write code to download file Pin
Christian Graus5-Dec-07 12:11
protectorChristian Graus5-Dec-07 12:11 
GeneralRe: how to write code to download file Pin
uowzd015-Dec-07 13:16
uowzd015-Dec-07 13:16 
QuestionSelectionColor in RichTextBox when minimized Pin
Johan Martensson5-Dec-07 11:45
Johan Martensson5-Dec-07 11:45 
Hi
I have the code below to minimize my form to the systemtray and bring it back up when the notifyicon is doubleclicked.
When the form is minimized some log-information is added in a richtextbox and I want the errors to be shown in red, so I set the selectioncolor to red.

My problem is that this only works if the form is in it's normal state otherwise all the text added will be black.
Does anyone know why I can't set the selectioncolor when the form is minimized?

private delegate void UpdateInfoDelegate(string newEvent, Color c);
private void UpdateInfo(string newEvent, Color c)
{
   rtbInfo.SelectionColor = c;
   rtbInfo.AppendText(newEvent);
   rtbInfo.SelectionColor = Color.Black;
}

public void SetInfoText(string text)
{
   rtbInfo.Invoke(new UpdateInfoDelegate(UpdateInfo), DateTime.Now + " " + text + "\r\n", Color.Black);
}

public void SetErrorText(string text)
{
   rtbInfo.Invoke(new UpdateInfoDelegate(UpdateInfo), DateTime.Now + " " + text + "\r\n", Color.Red);
}

private void Form1_Resize(object sender, EventArgs e)
{
   if (WindowState == FormWindowState.Minimized)
   {
      Hide();
      notifyIcon1.Visible = true;
   }
}

private void notifyIcon1_DoubleClick(object sender, EventArgs e)
{
   Show();
   WindowState = FormWindowState.Normal;
   notifyIcon1.Visible = false;
}



http://johanmartensson.se - Home of MPEG4Watcher

AnswerRe: SelectionColor in RichTextBox when minimized Pin
bcool6330316-Apr-09 4:46
bcool6330316-Apr-09 4:46 
GeneralDataset rowfilter Pin
Scalee5-Dec-07 10:19
Scalee5-Dec-07 10:19 
QuestionFraming JScript Exceptions in C#? Pin
kumar.bs5-Dec-07 10:02
kumar.bs5-Dec-07 10:02 
QuestionDataGridView DoubleClick Event handler fails when CTRL key is held while DoubleClicking Pin
alanteigne5-Dec-07 10:01
alanteigne5-Dec-07 10:01 
GeneralRe: DataGridView DoubleClick Event handler fails when CTRL key is held while DoubleClicking Pin
alanteigne6-Dec-07 2:07
alanteigne6-Dec-07 2:07 
AnswerRe: DataGridView DoubleClick Event handler fails when CTRL key is held while DoubleClicking Pin
alanteigne6-Dec-07 5:24
alanteigne6-Dec-07 5:24 
QuestionHow can I get the call stack of a StackOverflowException? Pin
Dr. Spack5-Dec-07 10:00
Dr. Spack5-Dec-07 10:00 
GeneralRe: How can I save the call stack of a StackOverflowException? Pin
Robert Royall5-Dec-07 10:50
Robert Royall5-Dec-07 10:50 
GeneralRe: How can I save the call stack of a StackOverflowException? Pin
Dr. Spack5-Dec-07 23:30
Dr. Spack5-Dec-07 23:30 
Generalnavigating all nodes in a win forms treeview Pin
radi85-Dec-07 8:38
radi85-Dec-07 8:38 
GeneralRe: navigating all nodes in a win forms treeview Pin
Giorgi Dalakishvili5-Dec-07 8:53
mentorGiorgi Dalakishvili5-Dec-07 8:53 
GeneralRe: navigating all nodes in a win forms treeview Pin
radi85-Dec-07 8:55
radi85-Dec-07 8:55 
GeneralRe: navigating all nodes in a win forms treeview Pin
Pete O'Hanlon5-Dec-07 9:19
mvePete O'Hanlon5-Dec-07 9:19 
GeneralRe: navigating all nodes in a win forms treeview Pin
radi86-Dec-07 6:10
radi86-Dec-07 6:10 
QuestionFind name of declaring property of an object Pin
Joby15-Dec-07 8:37
Joby15-Dec-07 8:37 
GeneralRe: Find name of declaring property of an object Pin
Christian Graus5-Dec-07 9:16
protectorChristian Graus5-Dec-07 9:16 
GeneralRe: Find name of declaring property of an object Pin
Pete O'Hanlon5-Dec-07 9:20
mvePete O'Hanlon5-Dec-07 9:20 

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.