WinForm实现自定义右下角提示效果的方法
本文实例讲述了WinForm实现自定义右下角提示效果的方法。分享给大家供大家参考。具体实现方法如下:
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 IcoFlickerApp
{
public partial class FrmMain : Form
{
public FrmMain()
{
InitializeComponent();
Rectangle rectangle = Screen.AllScreens[0].WorkingArea;
this.StartPosition = FormStartPosition.Manual;
this.Location = new Point(rectangle.Width - this.Width, rectangle.Height);
this.TopMost = true;
System.Threading.Thread thread = new System.Threading.Thread(() =>
{
while (this.Top >= rectangle.Height - this.Height)
{
this.Invoke(new MethodInvoker(delegate
{
this.Top = this.Top - 1;
System.Threading.Thread.Sleep(1);
Application.DoEvents();
}));
}
});
thread.Start();
}
}
}
希望本文所述对大家的C#程序设计有所帮助。
相关推荐
-
WinForm实现仿视频播放器左下角滚动新闻效果的方法
本文实例讲述了WinForm实现仿视频播放器左下角滚动新闻效果的方法.分享给大家供大家参考.具体实现方法如下: 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; using Syst
-
WinForm实现同时让两个窗体有激活效果的特效实例
本文实例讲述了WinForm实现同时让两个窗体有激活效果的特效.主要采用windows api实现一个窗体激活的时候给另外一个发消息.分享给大家供大家参考. 具体实现方法如下: using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsApplication43 { public partial class Form1 : Form { Form frm =nu
-
Winform实现鼠标可穿透的窗体镂空效果
今天找到一个名叫LICEcap的录屏软件,录制界面是这样的: 这个炫酷的空心窗口就是镜头,调整好大小,然后对准需要录制的地方按下Record就可以生成gif了. 卧槽太NB了我也要做一个! 根据StackOverflow站的提示(在这里),我们需要使用一个在Windows2000及之后平台可用的,用以实现不规则窗体的分层窗口API (SetLayerWindowAttributes).根据百度我们先需要使用一个名为SetWindowLong的Win32 API来把窗体设定为分层窗体. 为了在.N
-
winform下实现win7 Aero磨砂效果实现代码
效果图: 复制代码 代码如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; using System.ServiceModel; using System.Runtime.InteropServices; name
-
C#实现winform渐变效果的方法
本文实例实现一个启动画面,采用了显示Aform,过一段时间,隐藏这个Aform,showdialog下一个Bform,closeAForm这个方法来做了,不知道大家有没有更好的办法. 设定程序从Aform启动: 复制代码 代码如下: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Ru
-
C# WinForm实现Win7 Aero透明效果代码
在Vista系统之后,微软为窗体程序提供了Aero磨砂的效果,如下图.那么用C#如何来实现这种磨砂效果呢? 背景为我的桌面 那先上代码吧: [StructLayout(LayoutKind.Sequential)] public struct MARGINS { public int Left; public int Right; public int Top; public int Bottom; } [DllImport("dwmapi.dll", PreserveSig = fa
-
Winform窗体效果实例分析
本文实例分析了Winform窗体效果.分享给大家供大家参考.具体如下: using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace WindowsApplication4 { public partial cl
-
WinForm实现窗体最大化并遮盖任务栏的方法
本文实例讲述了WinForm实现窗体最大化并遮盖任务栏的方法.分享给大家供大家参考.具体实现方法如下: using System; using System.Windows.Forms; using System.Drawing; namespace CSImageFullScreenSlideShow { public class FullScreen { private FormWindowState winState; private FormBorderStyle brdStyle; p
-
WinForm实现状态栏跑马灯效果的方法示例
本文实例讲述了WinForm实现状态栏跑马灯效果的方法.分享给大家供大家参考,具体如下: 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 WindowsForm
-
C#实现WinForm禁止最大化、最小化、双击标题栏、双击图标等操作的方法
本文实例讲述了C#实现WinForm禁止最大化.最小化.双击标题栏.双击图标等操作的方法.分享给大家供大家参考.具体实现方法如下: protected override void WndProc(ref Message m) { if (m.Msg==0x112) { switch ((int) m.WParam) { //禁止双击标题栏关闭窗体 case 0xF063: case 0xF093: m.WParam = IntPtr.Zero; break; //禁止拖拽标题栏还原窗体 case
-
用 C# Winform做出全透明的磨砂玻璃窗体效果代码
首先, 调用系统 API, 这里如果要引用神马的, 就不一一列出了, 大家自己引用一下. 复制代码 代码如下: [StructLayout(LayoutKind.Sequential)] public struct MARGINS { public int Left; public int Right; public int Top; public int Bottom; } [DllImport("dwmapi.dll", PreserveSig = false)] public s
随机推荐
- PHP+jQuery 注册模块的改进(一):验证码存入SESSION
- Ruby实现的3种快速排序算法
- nodejs搭建本地http服务器教程
- vbs 注册表操作类代码
- c#生成图片缩略图的类(2种实现思路)
- asp.net get set用法第1/2页
- swfupload ajax无刷新上传图片实例代码
- blog程序新版本V2.0 Beta完成,提供V1.0全部源码下载
- php实现对象克隆的方法
- PHP-FPM实现性能优化
- PHP中的递归正则使用说明
- 在Python中使用poplib模块收取邮件的教程
- 动态调整textarea中字体的大小代码
- 常见表单重复提交问题整理及解决方法
- Jsp结合XML+XSLT将输出转换为Html格式
- Ruby实现的最短编辑距离计算方法
- jQuery定义插件的方法
- Spark整合Mongodb的方法
- 详解Vue项目中出现Loading chunk {n} failed问题的解决方法
- pandas的to_datetime时间转换使用及学习心得
