欧美大屁股bbbbxxxx,狼人大香伊蕉国产www亚洲,男ji大巴进入女人的视频小说,男人把ji大巴放进女人免费视频,免费情侣作爱视频

歡迎來(lái)到入門教程網(wǎng)!

C#教程

當(dāng)前位置:主頁(yè) > 軟件編程 > C#教程 >

C#實(shí)現(xiàn)帶消息數(shù)的App圖標(biāo)

來(lái)源:本站原創(chuàng)|時(shí)間:2020-01-10|欄目:C#教程|點(diǎn)擊: 次

上次寫(xiě)了一篇博文,但是每次更新圖標(biāo)時(shí),桌面會(huì)閃爍(刷新)//www.jb51.net/article/73350.htm,有博友說(shuō)人家的圖標(biāo)都不會(huì)刷新,還能動(dòng)畫(huà).我想了一下,如果要達(dá)到這個(gè)效果,可以用Form來(lái)實(shí)現(xiàn),就是在Form中嵌入一個(gè)圖片,然后用一個(gè)label來(lái)動(dòng)態(tài)顯示消息數(shù),關(guān)鍵是將Form的邊框隱藏,背景設(shè)為透明即可.如果要有旋轉(zhuǎn)或者縮放動(dòng)畫(huà),都可以用C#來(lái)實(shí)現(xiàn).

using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace AOPDemo
{
  public partial class AppIconMsg : Form
  {
    public AppIconMsg()
    {
      InitializeComponent();
      //設(shè)置背景為透明
      this.BackColor = Color.FromArgb(116, 164, 2);
      this.TransparencyKey = this.BackColor; 
      
    }

    private void AppIconMsg_Load(object sender, EventArgs e)
    {
      this.Width = 64;
      this.Height = 64;
      this.label1.Text = "99";
      this.timer1.Enabled = true;
      
    }

    // Drag it around the screen
    private const int WM_NCHITTEST = 0x84;
    private const int HTCAPTION = 0x2;
    protected override void WndProc(ref Message m)
    {
      //Disable mouseDoubleClick on form
      if (m.Msg == WM_LBUTTONDBLCLK)
      {
        Form2 frm = new Form2(msg);
        frm.Show();
        //this.Close();
        return;
      }

      if (m.Msg == WM_NCLBUTTONDBLCLK)
      {
        Form2 frm = new Form2(msg);
        frm.Show();
        // this.Close();
        return;
      }

      //drag
      if (m.Msg == WM_NCHITTEST)
        m.Result = new IntPtr(HTCAPTION);
      else
        base.WndProc(ref m);
    }
    private int msg = 0;
    private void timer1_Tick(object sender, EventArgs e)
    {
      int num = new Random().Next(1, 100);
      msg = num;
      this.label1.Text = num.ToString();
    }

    const int WM_LBUTTONDBLCLK = 0x0203;//client area
    const int WM_NCLBUTTONDBLCLK = 0x00A3;//non-client area
    private void toolStripExit_Click(object sender, EventArgs e)
    {
      this.Close();
    }

  }
}

上一篇:C#代碼實(shí)現(xiàn)對(duì)AES加密解密

欄    目:C#教程

下一篇:C#使用ImitateLogin模擬登錄百度

本文標(biāo)題:C#實(shí)現(xiàn)帶消息數(shù)的App圖標(biāo)

本文地址:http://mengdiqiu.com.cn/a1/C_jiaocheng/6783.html

網(wǎng)頁(yè)制作CMS教程網(wǎng)絡(luò)編程軟件編程腳本語(yǔ)言數(shù)據(jù)庫(kù)服務(wù)器

如果侵犯了您的權(quán)利,請(qǐng)與我們聯(lián)系,我們將在24小時(shí)內(nèi)進(jìn)行處理、任何非本站因素導(dǎo)致的法律后果,本站均不負(fù)任何責(zé)任。

聯(lián)系QQ:835971066 | 郵箱:835971066#qq.com(#換成@)

Copyright © 2002-2020 腳本教程網(wǎng) 版權(quán)所有