Exemplo n.º 1
0
        void NotifyIcon()
        {
            this.Hide();
            MyIcon.Visible         = true;
            MyIcon.Text            = "Snore";
            MyIcon.BalloonTipTitle = "Snore still running.";
            MyIcon.BalloonTipText  = "The program is located in the lower right corner.";
            MyIcon.BalloonTipIcon  = ToolTipIcon.Info;
            MyIcon.ShowBalloonTip(2000);

            // notifyIcon için event ataması yaptık
            MyIcon.MouseDoubleClick += new MouseEventHandler(notify_Icon_MouseDoubleClick);
        }
Exemplo n.º 2
0
        static private void IconStatements(MyIcon MIcon)
        {
            lock (olock)
            {
                if (MIcon == MyIcon.Error)
                {
                    MessageBeep(30);
                    frmIcon = Icon.FromHandle(largeIcon[109]);
                }

                if (MIcon == MyIcon.Explorer)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[220]);
                }

                if (MIcon == MyIcon.Find)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[22]);
                }

                if (MIcon == MyIcon.Information)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[221]);
                }

                if (MIcon == MyIcon.Mail)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[156]);
                }

                if (MIcon == MyIcon.Media)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[116]);
                }

                if (MIcon == MyIcon.Print)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[136]);
                }

                if (MIcon == MyIcon.Question)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[23]);
                }

                if (MIcon == MyIcon.RecycleBinEmpty)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[31]);
                }

                if (MIcon == MyIcon.RecycleBinFull)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[32]);
                }

                if (MIcon == MyIcon.Stop)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[27]);
                }

                if (MIcon == MyIcon.User)
                {
                    MessageBeep(0);
                    frmIcon = Icon.FromHandle(largeIcon[170]);
                }

                if (MIcon == MyIcon.Warning)
                {
                    MessageBeep(30);
                    frmIcon = Icon.FromHandle(largeIcon[217]);
                }
            }
        }
Exemplo n.º 3
0
        /// <summary>
        /// MIcon: Display MyIcon on the message box.
        /// </summary>
        static public DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon)
        {
            var msgBox = new BMsgForm(Message, Title, MButtons, MIcon);

            msgBox.ShowDialog();
            return(msgBox.CYReturnButton);
        }
        private static void IconStatements(MyIcon MIcon)
        {
            if (MIcon == MyIcon.Error)
            {
                MessageBeep(30);
                frmIcon = Icon.FromHandle(largeIcon[109]);
            }

            if (MIcon == MyIcon.Explorer)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[220]);
            }

            if (MIcon == MyIcon.Find)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[22]);
            }

            if (MIcon == MyIcon.Information)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[221]);
            }

            if (MIcon == MyIcon.Mail)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[156]);
            }

            if (MIcon == MyIcon.Media)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[116]);
            }

            if (MIcon == MyIcon.Print)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[136]);
            }

            if (MIcon == MyIcon.Question)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[23]);
            }

            if (MIcon == MyIcon.RecycleBinEmpty)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[31]);
            }

            if (MIcon == MyIcon.RecycleBinFull)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[32]);
            }

            if (MIcon == MyIcon.Stop)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[27]);
            }

            if (MIcon == MyIcon.User)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[170]);
            }

            if (MIcon == MyIcon.Warning)
            {
                MessageBeep(30);
                frmIcon = Icon.FromHandle(largeIcon[217]);
            }
        }
Exemplo n.º 5
0
 /// <summary>
 /// MIcon: Display MyIcon on the message box.
 /// </summary>
 static public DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon)
 {
     if (!IsInitiMess)
     {
         InitiMess();
     }
     lock (olock)
     {
         BuildMessageBox(Title);
         frmTitle.Text   = Title;
         frmMessage.Text = Message;
         ButtonStatements(MButtons);
         IconStatements(MIcon);
         Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38);
         pIcon.Image = imageIcon;
         newMessageBox.ShowDialog();
         return(CYReturnButton);
     }
 }
 /// <summary>
 /// MIcon: Display MyIcon on the message box.
 /// </summary>
 public static DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon)
 {
     BuildMessageBox(Title);
     frmMessageLabel.Text = Message;
     ButtonStatements(MButtons);
     IconStatements(MIcon);
     Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 32, 32);
     pIconPictureBox.Image = imageIcon;
     newMessageBox.ShowDialog();
     return direMyReturnButton;
 }
 /// <summary>
 /// RobotChooser: Display RobotChooserDataGridView on the messagebox.
 /// </summary>
 public static DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon, RobotChooser RChooser, DataTable robotDataTable)
 {
     BuildMessageBox(Title);
     frmMessageLabel.Text = Message;
     ButtonStatements(MButtons);
     IconStatements(MIcon);
     RobotChooserStatement(RChooser, robotDataTable);
     Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 32, 32);
     pIconPictureBox.Image = imageIcon;
     newMessageBox.Size = new System.Drawing.Size(400, 300);
     newMessageBox.ShowDialog();
     return direMyReturnButton;
 }
Exemplo n.º 8
0
 /// <summary>
 /// MIcon: Display MyIcon on the message box.
 /// </summary>
 static public DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon)
 {
     try
     {
         BuildMessageBox(Title);
         frmTitle.Text   = Title;
         frmMessage.Text = Message;
         ButtonStatements(MButtons);
         IconStatements(MIcon);
         Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38);
         pIcon.Image = imageIcon;
         newMessageBox.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "MyMsgBox", MessageBoxButtons.OK, MessageBoxIcon.Error);
         //LogHelper.LogWrite(ex);
     }
     return(CYReturnButton);
 }
Exemplo n.º 9
0
        private void button1_Click(object sender, EventArgs e)
        {
            MyIcon.Visible         = true;
            MyIcon.Text            = "SmarterThing - Kapatma Paneli";
            MyIcon.BalloonTipTitle = "SmarterThing'i Kapatın";
            MyIcon.BalloonTipText  = "SmarterThing Aşağıda Aktif Eğer Kapatmak İsterseniz Çift Tıklamanız Yeterlidir.";
            MyIcon.BalloonTipIcon  = ToolTipIcon.Info;
            MyIcon.ShowBalloonTip(30000);
            switch (cmbSehir.Text)
            {
            case "01 Adana": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0061:1:TU"; break;

            case "02 Adıyaman": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX6469:1:TU"; break;

            case "03 Afyon": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0046:1:TU"; break;

            case "04 Ağrı": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX1447:1:TU"; break;

            case "05 Amasya": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX1447:1:TU"; break;

            case "06 Ankara": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX1447:1:TU"; break;

            case "07 Antalya": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0004:1:TU"; break;

            case "08 Artvin": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX5851:1:TU"; break;

            case "09 Aydın": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0051:1:TU"; break;

            case "10 Balıkesir": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0041:1:TU"; break;

            case "11 Bilecik": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX7589:1:TU"; break;

            case "12 Bingöl": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX7894:1:TU"; break;

            case "13 Bitlis": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX9164:1:TU"; break;

            case "14 Bolu": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0032:1:TU"; break;

            case "15 Burdur": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX7352:1:TU"; break;

            case "16 Bursa": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0039:1:TU"; break;

            case "17 Çanakkale": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0037:1:TU"; break;

            case "18 Çankırı": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0797:1:TU"; break;

            case "19 Çorum": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0033:1:TU"; break;

            case "20 Denizli": frm.SehirLink = "https://weather.com/weather/5day/l/TUDI0132:1:TU"; break;

            case "21 Diyarbakır": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0010:1:TU"; break;

            case "22 Edirne": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0030:1:TU"; break;

            case "23 Elazığ": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0049:1:TU"; break;

            case "24 Erzincan": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0035:1:TU"; break;

            case "25 Erzurum": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0013:1:TU"; break;

            case "26 Eskişehir": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0040:1:TU"; break;

            case "27 Gaziantep": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0055:1:TU"; break;

            case "28 Giresun": frm.SehirLink = "https://weather.com/weather/5day/l/TUGE0190:1:TU"; break;

            case "29 Gümüşhane": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX5979:1:TU"; break;

            case "30 Hakkari": frm.SehirLink = "https://weather.com/weather/5day/l/TUHK0239:1:TU"; break;

            case "31 Hatay": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0451:1:TU"; break;

            case "32 Isparta": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0052:1:TU"; break;

            case "33 İçel (Mersin)": frm.SehirLink = "https://weather.com/weather/5day/l/TUML0382:1:TU"; break;

            case "34 İstanbul": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0014:1:TU"; break;

            case "35 İzmir": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0015:1:TU"; break;

            case "36 Kars": frm.SehirLink = "https://weather.com/weather/5day/l/TUXX0036:1:TU"; break;

            case "37 Kastamonu": frm.SehirLink = "https://weather.com/weather/5day/l/TUKT0762:1:TU"; break;

            case "38 Kayseri": frm.SehirLink = ""; break;

            case "39 Kırklareli": frm.SehirLink = ""; break;

            case "40 Kırşehir": frm.SehirLink = ""; break;

            case "41 Kocaeli": frm.SehirLink = ""; break;

            case "42 Konya": frm.SehirLink = ""; break;

            case "43 Kütahya": frm.SehirLink = ""; break;

            case "44 Malatya": frm.SehirLink = ""; break;

            case "45 Manisa": frm.SehirLink = ""; break;

            case "46 K.maraş": frm.SehirLink = ""; break;

            case "47 Mardin": frm.SehirLink = ""; break;

            case "48 Muğla": frm.SehirLink = ""; break;

            case "49 Muş": frm.SehirLink = ""; break;

            case "50 Nevşehir": frm.SehirLink = ""; break;

            case "51 Niğde": frm.SehirLink = ""; break;

            case "52 Ordu": frm.SehirLink = ""; break;

            case "53 Rize": frm.SehirLink = ""; break;

            case "54 Sakarya": frm.SehirLink = ""; break;

            case "55 Samsun": frm.SehirLink = ""; break;

            case "56 Siirt": frm.SehirLink = ""; break;

            case "57 Sinop": frm.SehirLink = ""; break;

            case "58 Sivas": frm.SehirLink = ""; break;

            case "59 Tekirdağ": frm.SehirLink = ""; break;

            case "60 Tokat": frm.SehirLink = ""; break;

            case "61 Trabzon": frm.SehirLink = ""; break;

            case "62 Tunceli": frm.SehirLink = ""; break;

            case "63 Şanlıurfa": frm.SehirLink = ""; break;

            case "64 Uşak": frm.SehirLink = ""; break;

            case "65 Van": frm.SehirLink = ""; break;

            case "66 Yozgat": frm.SehirLink = ""; break;

            case "67 Zonguldak": frm.SehirLink = ""; break;

            case "68 Aksaray": frm.SehirLink = ""; break;

            case "69 Bayburt": frm.SehirLink = ""; break;

            case "70 Karaman": frm.SehirLink = ""; break;

            case "71 Kırıkkale": frm.SehirLink = ""; break;

            case "72 Batman": frm.SehirLink = ""; break;

            case "73 Şırnak": frm.SehirLink = ""; break;

            case "74 Bartın": frm.SehirLink = ""; break;

            case "75 Ardahan": frm.SehirLink = ""; break;

            case "76 Iğdır": frm.SehirLink = ""; break;

            case "77 Yalova": frm.SehirLink = ""; break;

            case "78 Karabük": frm.SehirLink = ""; break;

            case "79 Kilis": frm.SehirLink = ""; break;

            case "80 Osmaniye": frm.SehirLink = ""; break;

            case "81 Düzce": frm.SehirLink = ""; break;
            }
            if (txtKullanici.Text == "" || txtSifre.Text == "" || txtEkranKoruyucuZamani.Text == "" || txtHaberAkisHizi.Text == "")
            {
                MessageBox.Show("Email, Şifre, Zamanlayıcı veya Haber Akış Hızı kutucuğu boş olamaz. Lütfen verileri kontrol edin", "SmarterThing - Hata Ekranı", MessageBoxButtons.OK, MessageBoxIcon.Error);
            }
            else
            {
                if (cmbDevredenCikarma.Text == "Mouse Hareketi İle")
                {
                    frm.DevredenCikart = "Hareket";
                }
                else
                {
                    frm.DevredenCikart = "Tıklama";
                }
                frm.ArkaPlanResmi      = file.FileName;
                frm.DevreyeGirisZamani = txtEkranKoruyucuZamani.Text;
                frm.HaberAkisHizi      = txtHaberAkisHizi.Text;
                frm.kullaniciAdi       = txtKullanici.Text;
                frm.ArkaPlanRengiR     = txtR.Text;
                frm.ArkaPlanRengiG     = txtG.Text;
                frm.ArkaPlanRengiB     = txtB.Text;
                if (chkSeffaf.Checked == true)
                {
                    frm.ArkaPlanSeffaf = "LightSalmon";
                }
                else
                {
                    frm.ArkaPlanSeffaf = "bosbu";
                }
                frm.sifre = txtSifre.Text;
                frm.Show();
                Hide();
            }
        }
Exemplo n.º 10
0
 /// <summary>
 /// MIcon: Display MyIcon on the message box.
 /// </summary>
 static public System.Windows.Forms.DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon, bool isChsLanguage)
 {
     lock (olock)
     {
         BuildMessageBox(Title);
         frmTitle.Text   = Title;
         frmMessage.Text = Message;
         ButtonStatements(MButtons, isChsLanguage);
         IconStatements(MIcon);
         System.Drawing.Image imageIcon = new System.Drawing.Bitmap(frmIcon.ToBitmap(), 38, 38);
         pIcon.Image = imageIcon;
         newMessageBox.ShowDialog();
         return(CYReturnButton);
     }
 }
        public Display()
        {
            joyX = 0;
            joyY = 0;
            A    = 1;
            B    = 1;
            X    = 1;
            Y    = 1;
            L    = 1;
            R    = 1;
            S    = 1;

            prevA = 1;
            prevB = 1;
            prevX = 1;
            prevY = 1;
            prevL = 1;
            prevR = 1;
            prevS = 1;

            countA = 0;
            countB = 0;
            countX = 0;
            countY = 0;
            countL = 0;
            countR = 0;
            countS = 0;

            folderIndex = 0;


            try
            {
                string[] lines      = System.IO.File.ReadAllLines("Index.ini");
                int      savedIndex = Int32.Parse(lines[0]);
                folderIndex = savedIndex;
            }
            catch {}

            reloadImages();

            stickPen  = new Pen(Color.Black, 1);
            fontArial = new Font("Arial", 16, FontStyle.Bold, GraphicsUnit.Point);

            recL = new Rectangle(40, 4, 96, 36);
            recY = new Rectangle(40, 52, 96, 36);
            recA = new Rectangle(40, 100, 96, 36);
            recR = new Rectangle(80, 4, 96, 36);
            recX = new Rectangle(80, 52, 96, 36);
            recB = new Rectangle(80, 100, 96, 36);
            recS = new Rectangle(60, 28, 96, 36);

            formatLeft   = new StringFormat();
            formatCenter = new StringFormat();
            formatRight  = new StringFormat();

            formatLeft.Alignment     = StringAlignment.Near;
            formatLeft.LineAlignment = StringAlignment.Center;

            formatCenter.Alignment     = StringAlignment.Center;
            formatCenter.LineAlignment = StringAlignment.Center;

            formatRight.Alignment     = StringAlignment.Far;
            formatRight.LineAlignment = StringAlignment.Center;

            this.DoubleBuffered = true;
            try
            {
                this.Icon = new Icon(MyIcon.getIconStream());
            }
            catch {}

            this.KeyPreview      = true;
            this.PreviewKeyDown += new PreviewKeyDownEventHandler(keyPress);
        }
Exemplo n.º 12
0
        /// <summary>
        /// modified by fenggy 2008-06-12 缩略图模仿系统的方式,但文件夹下如果有图像,和普通文件夹一样
        /// </summary>
        /// <param name="fileName"></param>
        /// <param name="imgWidth"></param>
        /// <param name="imgHeight"></param>
        /// <param name="penColor"></param>
        /// <returns></returns>
        public static Image GetThumbNail(string fileName, int imgWidth, int imgHeight, Color penColor)
        {
            Bitmap bmp;
            int    BreviaryMapX = imgWidth;
            int    BreviaryMapY = imgHeight;

            try
            {
                //临时写法,到时候读配置文件
                string _strImageType = ".jpg,.png,.gif,.bmp";

                if (File.Exists(fileName))
                {//文件缩略图
                    if (_strImageType.Contains(Path.GetExtension(fileName).ToLower()))
                    {
                        bmp = new Bitmap(fileName);
                    }
                    else
                    {
                        bmp = MyIcon.GetSystemIcon(fileName, GetSystemIconType.PathLarge).ToBitmap();
                    }
                }
                else if (Directory.Exists(fileName))
                {//文件夹缩略图
                    bmp = MyIcon.GetSystemIcon(fileName, GetSystemIconType.PathLarge).ToBitmap();
                }
                else
                {
                    bmp = new Bitmap(imgWidth, imgHeight); //If we cant load the image, create a blank one with ThumbSize
                }
            }
            catch
            {
                bmp = new Bitmap(imgWidth, imgHeight);
            }


            imgWidth  = bmp.Width > imgWidth ? imgWidth : bmp.Width;
            imgHeight = bmp.Height > imgHeight ? imgHeight : bmp.Height;

            //Bitmap retBmp = new Bitmap(imgWidth, imgHeight, System.Drawing.Imaging.PixelFormat.Format64bppPArgb);

            //Graphics grp = Graphics.FromImage(retBmp);


            int tnWidth = imgWidth, tnHeight = imgHeight;

            if (bmp.Width > bmp.Height)
            {
                tnHeight = (int)(((float)bmp.Height / (float)bmp.Width) * tnWidth);
            }
            else if (bmp.Width < bmp.Height)
            {
                tnWidth = (int)(((float)bmp.Width / (float)bmp.Height) * tnHeight);
            }

            //int iLeft = (imgWidth / 2) - (tnWidth / 2);
            //int iTop = (imgHeight / 2) - (tnHeight / 2);

            //grp.PixelOffsetMode = PixelOffsetMode.None;
            //grp.InterpolationMode = InterpolationMode.HighQualityBicubic;

            //grp.DrawImage(bmp, iLeft, iTop, tnWidth, tnHeight);

            Pen pn = new Pen(penColor, 1); //Color.Wheat
            //grp.DrawRectangle(pn, 0, 0, retBmp.Width - 1, retBmp.Height - 1);

            Bitmap   b = new Bitmap(BreviaryMapX, BreviaryMapY);
            Graphics g = Graphics.FromImage(b);

            g.DrawRectangle(pn, 0, 0, BreviaryMapX - 1, BreviaryMapY - 1);
            //Point pt = new Point((int)((BreviaryMapX - tnWidth) / 2), (int)(((BreviaryMapY - tnHeight) / 2)));
            int ix = (BreviaryMapX - tnWidth) / 2;
            int iy = (BreviaryMapY - tnHeight) / 2;

            g.DrawImage(bmp, new Rectangle(ix, iy, tnWidth, tnHeight), new Rectangle(0, 0, bmp.Width, bmp.Height), GraphicsUnit.Pixel);
            //g.Save();
            g.Dispose();

            return(b);
        }
Exemplo n.º 13
0
        static private void IconStatements(MyIcon MIcon)
        {
            if (MIcon == MyIcon.Error)
            {
                MessageBeep(30);
                frmIcon = Icon.FromHandle(Resources.face_crying.GetHicon());
            }

            if (MIcon == MyIcon.Explorer)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[220]);
            }

            if (MIcon == MyIcon.Find)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[22]);
            }

            if (MIcon == MyIcon.Information)
            {
                frmIcon = Icon.FromHandle(Resources.wx.GetHicon());
            }

            if (MIcon == MyIcon.Mail)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[156]);
            }

            if (MIcon == MyIcon.Media)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[116]);
            }

            if (MIcon == MyIcon.Print)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[136]);
            }

            if (MIcon == MyIcon.Question)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(Resources.xw.GetHicon());
            }

            if (MIcon == MyIcon.RecycleBinEmpty)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[31]);
            }

            if (MIcon == MyIcon.RecycleBinFull)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[32]);
            }

            if (MIcon == MyIcon.Stop)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[27]);
            }

            if (MIcon == MyIcon.User)
            {
                MessageBeep(0);
                frmIcon = Icon.FromHandle(largeIcon[170]);
            }

            if (MIcon == MyIcon.Warning)
            {
                MessageBeep(30);
                frmIcon = Icon.FromHandle(largeIcon[217]);
            }
        }
Exemplo n.º 14
0
 /// <summary>
 /// MIcon: Display MyIcon on the message box.
 /// </summary>
 static public DialogResult Show(string Message, string Title, MyButtons MButtons, MyIcon MIcon)
 {
     try
     {
         BuildMessageBox(Title);
         frmTitle.Text   = Title;
         frmMessage.Text = Message;
         ButtonStatements(MButtons);
         if (MIcon == MyIcon.Error)
         {
             LogHelper.WriteLog("MyMsgBox异常异常信息记录:", " try  catch Exception", Message);
             OpaqueCommand oc = new OpaqueCommand(125, true); //加载层
             oc.HideOpaqueLayer();
         }
         IconStatements(MIcon);
         Image imageIcon = new Bitmap(frmIcon.ToBitmap(), 38, 38);
         pIcon.Image = imageIcon;
         newMessageBox.ShowDialog();
     }
     catch (Exception ex)
     {
         MessageBox.Show(ex.Message, "MyMsgBox", MessageBoxButtons.OK, MessageBoxIcon.Error);
         LogHelper.WriteLog("MyMsgBox", " MyMsgBox", ex.Message);
     }
     return(CYReturnButton);
 }