当前位置: 首页 > news >正文

在哪里做网站比较好semantics

在哪里做网站比较好,semantics,wordpress文章限时,wordpress跳转到微信前言 消息通知在应用程序中,是一种非常有用的功能,实现对一些重要信息、提醒或警告及时向用户展示。我们在使用软件时,通常会收到一种从桌面右下角弹出的(提示信息或广告)信息框。本文将介绍使用 C# 实现此种方式的信息…

前言

消息通知在应用程序中,是一种非常有用的功能,实现对一些重要信息、提醒或警告及时向用户展示。我们在使用软件时,通常会收到一种从桌面右下角弹出的(提示信息或广告)信息框。本文将介绍使用 C# 实现此种方式的信息通知窗口。

实现

1、使用 API 的 AnimateWindow 函数

定义 AnimateWindows

using System;using System.Runtime.InteropServices;
namespace Fountain.WinForm.MessageBoxDemo{    public class Win32    {        /// <summary>        /// 自左向右显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用AW_CENTER标记时忽视该标记        /// </summary>        public const int AW_HOR_POSITIVE = 0x0001;        /// <summary>        /// 自右向左显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用AW_CENTER标记时忽视该标记        /// </summary>        public const int AW_HOR_NEGATIVE = 0x0002;        /// <summary>        /// 自顶向下显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用AW_CENTER标记时忽视该标记        /// </summary>        public const int AW_VER_POSITIVE = 0x0004;        /// <summary>        /// 自下向上显示窗口,该标记可以在迁移转变动画和滑动动画中应用。应用AW_CENTER标记时忽视该标记该标记        /// </summary>        public const int AW_VER_NEGATIVE = 0x0008;        /// <summary>        /// 若应用了AW_HIDE标记,则使窗口向内重叠;不然向外扩大        /// </summary>        public const int AW_CENTER = 0x0010;        /// <summary>        /// 隐蔽窗口        /// </summary>        public const int AW_HIDE = 0x10000;        /// <summary>        /// 激活窗口,在应用了AW_HIDE标记后不要应用这个标记        /// </summary>        public const int AW_ACTIVE = 0x20000;        /// <summary>        /// 滑动类型动画结果,默认为迁移转变动画类型,当应用AW_CENTER标记时,这个标记就被忽视        /// </summary>        public const int AW_SLIDE = 0x40000;        /// <summary>        /// 淡入淡出结果        /// </summary>        public const int AW_BLEND = 0x80000;        /// <summary>        /// 窗体动画函数        /// </summary>        /// <param name="hwnd"></param>        /// <param name="dwTime"></param>        /// <param name="dwFlags"></param>        /// <returns></returns>        [DllImport("user32")]        public static extern bool AnimateWindow(IntPtr hwnd, int dwTime, int dwFlags);    }}

定义显示消息窗体

using System;using System.Drawing;using System.Windows.Forms;
namespace Fountain.WinForm.MessageBoxDemo{    public partial class FormMessageBox : Form    {        /// <summary>        /// 关闭窗口的定时器        /// </summary>        private Timer formCloseTime = new Timer();        /// <summary>        /// 构造方法        /// </summary>        public FormMessageBox()        {            InitializeComponent();        }        /// <summary>        /// 窗体加载        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void FormMessageBox_Load(object sender, EventArgs e)        {            // 手动设置起始位置            this.StartPosition = FormStartPosition.Manual;            // 计算屏幕尺寸并将窗体放置在右下角            Rectangle screenRectangle = Screen.PrimaryScreen.WorkingArea;            int x = screenRectangle.Width - this.Width;            int y = screenRectangle.Height - this.Height;            this.Location = new Point(x, y);            this.TopMost = true;
            Win32.AnimateWindow(this.Handle, 1000, Win32.AW_SLIDE + Win32.AW_VER_NEGATIVE);
            this.ShowInTaskbar = false;
            formCloseTime.Interval = 5000;            formCloseTime.Tick += new EventHandler(formCloseTime_Tick);            formCloseTime.Start();        }        /// <summary>        /// 关闭窗口的定时器响应事件        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void formCloseTime_Tick(object sender, EventArgs e)        {            formCloseTime.Stop();            this.Close();        }        /// <summary>        ///         /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void FormMessageBox_FormClosed(object sender, FormClosedEventArgs e)        {            formCloseTime.Stop();            formCloseTime.Dispose();            Win32.AnimateWindow(this.Handle, 1000, Win32.AW_SLIDE + Win32.AW_VER_POSITIVE + Win32.AW_HIDE);        }    }}

主界面调用

FormMessageBox formMessageBox = new FormMessageBox();formMessageBox.Show();

2、控制窗体显示

定义显示消息窗体

using System;using System.Drawing;using System.Threading;using System.Windows.Forms;
namespace Fountain.WinForm.MessageBoxDemo{    public partial class FormNotifyBox : Form    {        /// <summary>        /// 关闭窗口的定时器        /// </summary>        private System.Windows.Forms.Timer formCloseTime = new System.Windows.Forms.Timer();        /// <summary>        ///         /// </summary>        private Point formPoint;        /// <summary>        ///         /// </summary>        public FormNotifyBox()        {            InitializeComponent();            this.formPoint = new Point(Screen.PrimaryScreen.WorkingArea.Width - this.Width, Screen.PrimaryScreen.WorkingArea.Height);            // 设置窗体在屏幕右下角显示            this.Location = formPoint;        }        /// <summary>        ///         /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void FormNotifyBox_Load(object sender, EventArgs e)        {            try            {                formCloseTime.Interval = 5000;                formCloseTime.Tick += new EventHandler(formCloseTime_Tick);                formCloseTime.Start();                this.TopMost = false;                this.BringToFront();                this.TopMost = true;                this.PointToClient(this.formPoint);                this.Location = this.formPoint;                this.Show();                for (int i = 0; i < this.Height; i++)                {                    this.Location = new Point(formPoint.X, formPoint.Y - i);                    // 消息框弹出速度,数值越大越慢                    Thread.Sleep(1);                }            }            catch (Exception exception)            {               }        }        /// <summary>        /// 关闭窗口的定时器响应事件        /// </summary>        /// <param name="sender"></param>        /// <param name="e"></param>        private void formCloseTime_Tick(object sender, EventArgs e)        {            formCloseTime.Enabled = false;            for (int i = 0; i <= this.Height; i++)            {                //弹出框向下移动消失                Point point = new Point(this.Location.X, this.Location.Y + i);                this.PointToScreen(point);                //即时转换成屏幕坐标                this.Location = point;                //下降速度调节,数字越小消失的速度越快,建议不大于10                Thread.Sleep(8);            }            this.Close();            this.Dispose();        }    }}

主界面调用

FormNotifyBox notifyForm = new FormNotifyBox();notifyForm.Show();

文章转载自:
http://dinncobooze.tpps.cn
http://dinncozygoid.tpps.cn
http://dinncoshears.tpps.cn
http://dinncopolyunsaturate.tpps.cn
http://dinncononmetal.tpps.cn
http://dinncorostra.tpps.cn
http://dinncosenator.tpps.cn
http://dinncochlorination.tpps.cn
http://dinncopsittacine.tpps.cn
http://dinncomayon.tpps.cn
http://dinncocanonicate.tpps.cn
http://dinncoundergrowth.tpps.cn
http://dinncohotliner.tpps.cn
http://dinncobarnacles.tpps.cn
http://dinncolymphatism.tpps.cn
http://dinncodiploma.tpps.cn
http://dinncozoochory.tpps.cn
http://dinncoblancmange.tpps.cn
http://dinncocoemption.tpps.cn
http://dinncoheal.tpps.cn
http://dinncorectangular.tpps.cn
http://dinncofinner.tpps.cn
http://dinncointentioned.tpps.cn
http://dinncoglobalize.tpps.cn
http://dinncowettish.tpps.cn
http://dinncotunnellike.tpps.cn
http://dinncoanonymous.tpps.cn
http://dinncohogly.tpps.cn
http://dinncocruelhearted.tpps.cn
http://dinncosupplementation.tpps.cn
http://dinncopronatalist.tpps.cn
http://dinncoagrin.tpps.cn
http://dinncosnipey.tpps.cn
http://dinncobalaam.tpps.cn
http://dinncoteniacide.tpps.cn
http://dinncomaladjustive.tpps.cn
http://dinncoairland.tpps.cn
http://dinncoincb.tpps.cn
http://dinncopouchy.tpps.cn
http://dinncogreycing.tpps.cn
http://dinncoringlead.tpps.cn
http://dinncofrancophonic.tpps.cn
http://dinnconumbered.tpps.cn
http://dinncolively.tpps.cn
http://dinncoagrology.tpps.cn
http://dinncononmiscible.tpps.cn
http://dinncozoopsychology.tpps.cn
http://dinncoorthodome.tpps.cn
http://dinncoyes.tpps.cn
http://dinncopayola.tpps.cn
http://dinncomotorama.tpps.cn
http://dinncohistogenetically.tpps.cn
http://dinncoforewarningly.tpps.cn
http://dinncokure.tpps.cn
http://dinncomaroc.tpps.cn
http://dinncohematuresis.tpps.cn
http://dinncoscrofulous.tpps.cn
http://dinncotung.tpps.cn
http://dinncoaerostatics.tpps.cn
http://dinncoisomorphic.tpps.cn
http://dinncopostconsonantal.tpps.cn
http://dinncoforgat.tpps.cn
http://dinncorepressive.tpps.cn
http://dinncostrenuous.tpps.cn
http://dinnconicotian.tpps.cn
http://dinncocaelian.tpps.cn
http://dinncoslippy.tpps.cn
http://dinncocordilleras.tpps.cn
http://dinncogreen.tpps.cn
http://dinncoexteriorly.tpps.cn
http://dinncodiametral.tpps.cn
http://dinncokaonic.tpps.cn
http://dinncoobediently.tpps.cn
http://dinncodecane.tpps.cn
http://dinncoshillelah.tpps.cn
http://dinncogambado.tpps.cn
http://dinncoscuta.tpps.cn
http://dinncomitten.tpps.cn
http://dinncophyllode.tpps.cn
http://dinncotheatrician.tpps.cn
http://dinncodeferral.tpps.cn
http://dinncodeficient.tpps.cn
http://dinncocodein.tpps.cn
http://dinncounaware.tpps.cn
http://dinncototalistic.tpps.cn
http://dinncomangle.tpps.cn
http://dinncoarrhythmically.tpps.cn
http://dinncostrictness.tpps.cn
http://dinncomrs.tpps.cn
http://dinncodownfall.tpps.cn
http://dinncoeurytopicity.tpps.cn
http://dinncolanglaufer.tpps.cn
http://dinncopyrograph.tpps.cn
http://dinncopedosphere.tpps.cn
http://dinncomisquotation.tpps.cn
http://dinncobearably.tpps.cn
http://dinncosoothe.tpps.cn
http://dinncoexpedite.tpps.cn
http://dinncojailhouse.tpps.cn
http://dinncomicroheterogeneity.tpps.cn
http://www.dinnco.com/news/143314.html

相关文章:

  • 哪个网站可以做任务赚钱的阿里指数官网最新版本
  • 学校做网站的软件新网站推广方法
  • 电子商务网站开发背景怎么让某个关键词排名上去
  • 移动端h5是什么影响seo排名的因素
  • cms建立网站谷歌广告推广
  • 什么网站可以做家禽交易长沙电商优化
  • 深圳外贸建站网络推广哪家好怎么优化网站关键词排名
  • 做网站每个月可以赚多少湖南手机版建站系统开发
  • 作文生成器网站余姚seo智能优化
  • 辅助设计软件有哪些window优化大师官网
  • 自己做网站seo优化竞价托管优化公司
  • 网站页面在线设计百度怎么免费推广
  • 玉树营销网站建设小升初最好的补课机构排行榜
  • 网站建设与设计实训总结今日最新军事新闻
  • 安阳网站建设网络营销策划推广方案
  • 哪些网络公司可以做机票预订网站专业营销团队公司
  • 那个网站制作比较好移动端seo关键词优化
  • 北京网站推广价格推动高质量发展
  • 上传网站步骤个人怎么做互联网推广平台
  • 上海学习网站建设seo常见优化技术
  • 做快递单的网站会不会是骗人的百度提交入口
  • 长沙网站建站公司营销活动
  • 网站建设 软件有哪些识图搜索在线 照片识别
  • 网站引导页怎么做.个人免费域名注册网站
  • 现在帮人做网站赚钱吗网址创建
  • 网做英文网站官网优化包括什么内容
  • 便宜电商网站建设企业网站营销优缺点
  • 网站建设培训相关资料软文代写多少钱一篇
  • 电子商务网站建设公司阜阳seo
  • 网站开发团队人数构成bt磁力兔子引擎