Пример #1
0
        public void setNotif(string pesan, ModernNotification.NotifTypeEnum tipe)
        {
            this.Opacity       = 0.0;
            this.StartPosition = FormStartPosition.Manual;
            string fname;

            for (int i = 1; i < 10; i++)
            {
                fname = "alert" + i.ToString();
                ModernNotification f = (ModernNotification)Application.OpenForms[fname];

                if (f == null)
                {
                    this.Name     = fname;
                    this.x        = Screen.PrimaryScreen.WorkingArea.Width - this.Width + 15;
                    this.y        = Screen.PrimaryScreen.WorkingArea.Height - this.Height * i - 5 * i;
                    this.Location = new Point(this.x, this.y);
                    break;
                }
            }
            this.x = Screen.PrimaryScreen.WorkingArea.Width - base.Width - 5;
            switch (tipe)
            {
            case ModernNotification.NotifTypeEnum.Default:
                this.BackColor = Color.FromArgb(47, 52, 56);
                break;
            }
            this.label2.Text = pesan;
            this.Show();
            this.Show();
            this.action          = actionEnum.start;
            this.timer1.Interval = 1;
            this.timer1.Start();
        }
Пример #2
0
        //NOTIFICATION
        public void Notification(string pesan, ModernNotification.NotifTypeEnum tipe)
        {
            ModernNotification baru = new ModernNotification();

            baru.setNotif(pesan, tipe);
        }