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; namespace WindowsForm
-
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
-
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
-
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窗体效果实例分析
本文实例分析了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
-
用 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渐变效果的方法
本文实例实现一个启动画面,采用了显示Aform,过一段时间,隐藏这个Aform,showdialog下一个Bform,closeAForm这个方法来做了,不知道大家有没有更好的办法. 设定程序从Aform启动: 复制代码 代码如下: static void Main() { Application.EnableVisualStyles(); Application.SetCompatibleTextRenderingDefault(false); Application.Ru
-
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实现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
随机推荐
- 解决js下referer兼容各大浏览器的方法
- java基于swing实现的五子棋游戏代码
- Flex 编程注意之Flex Complier参数
- Oracle客户端的安装与远程连接配置方法分享
- ASP.NET设计FTP文件上传的解决方案
- Apache实现Web Server负载均衡详解(不考虑Session版)
- Android入门之TabHost与TabWidget实例解析
- ASP所有的Session变量获取实现代码
- Unity UGUI教程之实现滑页效果
- PHP实现的迪科斯彻(Dijkstra)最短路径算法实例
- JavaScript中URL编码函数代码
- Java语言实现简单FTP软件 辅助功能模块FTP站点管理实现(12)
- 话说Spring Security权限管理(源码详解)
- Oracle数据安全面面观
- Windows系统下安装Node.js的步骤图文详解
- Java定时器Timer简述
- JQuery for与each性能比较分析
- php关联数组与索引数组及其显示方法
- Java并发计数器的深入理解
- 实现一个 Vue 吸顶锚点组件方法