[archived content]

About

Also called a tray icon NotifyIcon? is used to manipulate an icon outside of the normal view of a window.

Usage

Generally NotifyIcon? is used for its ContextMenu?. Text is the ToolTip? shown for the icon, and icon is the image of the NotifyIcon?.

Example

import dfl.all;

void main() {
        auto form = new Form;
        form.dockPadding.all = 5;

        auto label = new Label;
        label.text = "Look for the NotifyIcon!";
        label.dock = DockStyle.FILL;
        form.controls.add(label);

        auto notifyIcon = new NotifyIcon;
        notifyIcon.text = "Simple ToolTip";
        notifyIcon.icon = SystemIcons.application;

        notifyIcon.contextMenu = new ContextMenu;
        auto currentMenuItem = new MenuItem;
        currentMenuItem.text = "Example Menu";
        currentMenuItem.click ~= delegate void (MenuItem m, EventArgs e) {
                label.text = label.text ~ "\nYou Found IT!";
        };
        notifyIcon.contextMenu.menuItems.add(currentMenuItem);
        notifyIcon.visible = true;

        Application.run(form);
}

module dfl.notifyicon;
public class NotifyIcon
{
public Event click(NotifyIcon,EventArgs);
public final ContextMenu contextMenu; [property setter]
public final ContextMenu contextMenu; [property getter]
public Event doubleClick(NotifyIcon,EventArgs);
public final Icon icon; [property setter]
public final Icon icon; [property getter]
public void minimize(IWindow win);
public Event mouseDown(NotifyIcon,MouseEventArgs);
public Event mouseMove(NotifyIcon,MouseEventArgs);
public Event mouseUp(NotifyIcon,MouseEventArgs);
public void restore(IWindow win);
public final char[] text; [property getter]
public final char[] text; [property setter]
public final bool visible; [property setter]
public final bool visible; [property getter]
}

Page last modified on July 03, 2008, at 09:15 PM