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#程序设计有所帮助。
相关推荐
-
用 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
-
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渐变效果的方法
本文实例实现一个启动画面,采用了显示Aform,过一段时间,隐藏这个Aform,showdialog下一个Bform,closeAForm这个方法来做了,不知道大家有没有更好的办法. 设定程序从Aform启动: 复制代码 代码如下: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Ru
-
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实现鼠标可穿透的窗体镂空效果
今天找到一个名叫LICEcap的录屏软件,录制界面是这样的: 这个炫酷的空心窗口就是镜头,调整好大小,然后对准需要录制的地方按下Record就可以生成gif了. 卧槽太NB了我也要做一个! 根据StackOverflow站的提示(在这里),我们需要使用一个在Windows2000及之后平台可用的,用以实现不规则窗体的分层窗口API (SetLayerWindowAttributes).根据百度我们先需要使用一个名为SetWindowLong的Win32 API来把窗体设定为分层窗体. 为了在.N
-
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下实现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
-
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
-
WinForm实现同时让两个窗体有激活效果的特效实例
本文实例讲述了WinForm实现同时让两个窗体有激活效果的特效.主要采用windows api实现一个窗体激活的时候给另外一个发消息.分享给大家供大家参考. 具体实现方法如下: using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsApplication43 { public partial class Form1 : Form { Form frm =nu
-
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.Windows.Forms; using System.Drawing; namespace CSImageFullScreenSlideShow { public class FullScreen { private FormWindowState winState; private FormBorderStyle brdStyle; p
随机推荐
- ionic选择多张图片上传的示例代码
- ubuntu14.04+docker的安装及使用
- Powershell小技巧之使用Copy-Item添加程序到开机启动
- iOS实现的多条折线图封装实例
- java 中JFinal getModel方法和数据库使用出现问题解决办法
- javascript获得CheckBoxList选中的数量
- PHP更安全的密码加密机制Bcrypt详解
- Jsp连接Access数据库(不通过建立ODBC数据源的方法)
- JS和css实现检测移动设备方向的变化并判断横竖屏幕
- Bootstrap零基础入门教程(二)
- PHP常用工具类大全附全部代码下载
- PHP中Enum(枚举)用法实例详解
- 实现了一个PHP5的getter/setter基类的代码
- php版微信小店API二次开发及使用示例
- Java中使用json与前台Ajax数据交互的方法
- linux下mysql数据库的操作的方法
- PHP用mysql数据库存储session的代码
- 详解Android Service 使用时的注意事项
- 网络世界的“后门” -端口的故事①
- Python random模块用法解析及简单示例