0

I want to show a notifyicon if for this code:

if (textbox.text == "hello");

Anyone have an idea on how i can do this?

2 Answers2

0

Check this link

Notify Icon In C# Form

This code worked for me(set on a button click)

private void button1_Click(object sender, EventArgs e)
    {
        if (textBox1.Text == "hello")
        {
            notifyIcon1.BalloonTipText = "hi";
            notifyIcon1.ShowBalloonTip(100);
        }
    }

Remember to add an icon to the notifyicon element.

Nitish
  • 776
  • 3
  • 13
0

It looks something like this probably.

if (textBox1.Text.ToLower() == "hello")
   notifyIcon1.Visible = true;
else
   notifyIcon1.Visible = false;

it shows and hides the notificationicon control

NOTE: add this to an event if you want it to perform automatically or call it explicitly using a method.

DevEstacion
  • 1,947
  • 1
  • 14
  • 28