NotifyIcon

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Peter Holschbach

    NotifyIcon

    Hi all,

    I've a application where I need to use NotifyIcon in a other way round. My normal windows application sometimes has to collect data. In this case I want to hide all formulares and just show a icon in the system tray.
    I've added a NotifyIcon and a button to a form:

    private void button1_Click(o bject sender, EventArgs e)
    {
    this.Visible = false;
    notifyIcon1.Vis ible = true;
    }

    click on the button hides the formular (perfect) but it also hides the icon in the system tray (not what I intended :-()
    any idea ?

    thanx
  • Ignacio Machin \( .NET/ C# MVP \)

    #2
    Re: NotifyIcon

    Hi,

    What you mean with hide the Icon in the system tray?

    IIRC the way of doing it is to make the window minimized.

    Take a look at my post here http://www.thescripts.com/forum/thread265639.html


    --
    Ignacio Machin
    The #1 Warehouse Management System & Direct Store Delivery Software (DSD) for QuickBooks & ERP Systems – LaceUp Solutions

    Mobile & warehouse Solutions.
    "Peter Holschbach" <mailnot@thisad dress.dewrote in message news:foqbt6$mss $1@news.citykom .de...
    Hi all,

    I've a application where I need to use NotifyIcon in a other way round. My normal windows application sometimes has to collect data. In this case I want to hide all formulares and just show a icon in the system tray.
    I've added a NotifyIcon and a button to a form:

    private void button1_Click(o bject sender, EventArgs e)
    {
    this.Visible = false;
    notifyIcon1.Vis ible = true;
    }

    click on the button hides the formular (perfect) but it also hides the icon in the system tray (not what I intended :-()
    any idea ?

    thanx

    Comment

    • =?ISO-8859-1?Q?Bj=F8rn_Brox?=

      #3
      Re: NotifyIcon

      Peter Holschbach skrev:
      Hi all,
      >
      I've a application where I need to use NotifyIcon in a other way round.
      My normal windows application sometimes has to collect data. In this
      case I want to hide all formulares and just show a icon in the system tray.
      I've added a NotifyIcon and a button to a form:
      >
      private void button1_Click(o bject sender, EventArgs e)
      {
      this.Visible = false;
      notifyIcon1.Vis ible = true;
      }
      >
      click on the button hides the formular (perfect) but it also hides the
      icon in the system tray (not what I intended :-()
      any idea ?
      >
      Wild guess: Set notify icon visible first, and then perform a hide().
      I guess using Hide() does a better job than just setting the visible
      variable.
      The notifyIcon1 Click action is of course this.show().

      notifyIcon1.Vis ible = true;
      this.Hide();

      --
      Bjørn Brox

      Comment

      • Ben Voigt [C++ MVP]

        #4
        Re: NotifyIcon

        Peter Holschbach wrote:
        Hi all,
        >
        I've a application where I need to use NotifyIcon in a other way
        round. My normal windows application sometimes has to collect data.
        In this case I want to hide all formulares and just show a icon in
        the system tray.
        I've added a NotifyIcon and a button to a form:
        >
        private void button1_Click(o bject sender, EventArgs e)
        {
        this.Visible = false;
        notifyIcon1.Vis ible = true;
        }
        >
        click on the button hides the formular (perfect) but it also hides
        the icon in the system tray (not what I intended :-()
        any idea ?
        What if the NotifyIcon wasn't parented to the Form? Setting Visible false
        on a container automatically overrides Visible for all children (the
        children will remember the setting but will not use it until the parent
        becomes Visible=true again).
        >
        thanx

        Comment

        Working...