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
-
用 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
-
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窗体效果.分享给大家供大家参考.具体如下: 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实现同时让两个窗体有激活效果的特效.主要采用windows api实现一个窗体激活的时候给另外一个发消息.分享给大家供大家参考. 具体实现方法如下: using System; using System.Windows.Forms; using System.Runtime.InteropServices; namespace WindowsApplication43 { public partial class Form1 : Form { Form frm =nu
-
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禁止最大化、最小化、双击标题栏、双击图标等操作的方法
本文实例讲述了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实现鼠标可穿透的窗体镂空效果
今天找到一个名叫LICEcap的录屏软件,录制界面是这样的: 这个炫酷的空心窗口就是镜头,调整好大小,然后对准需要录制的地方按下Record就可以生成gif了. 卧槽太NB了我也要做一个! 根据StackOverflow站的提示(在这里),我们需要使用一个在Windows2000及之后平台可用的,用以实现不规则窗体的分层窗口API (SetLayerWindowAttributes).根据百度我们先需要使用一个名为SetWindowLong的Win32 API来把窗体设定为分层窗体. 为了在.N
-
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
随机推荐
- js匹配网址url的正则表达式集合
- 关于系统重装后Oracle数据库完全恢复的解决办法
- Js 导出table内容到Excel的简单实例
- web.config中配置数据库连接的方式
- ASP.NET MVC:Filter和Action的执行介绍
- C#静态static的用法实例分析
- Asp.net中的数据绑定Eval和Bind应用示例
- 学习discuz php 引入文件的方法DISCUZ_ROOT
- Python中用altzone()方法处理时区的教程
- Python学习小技巧之利用字典的默认行为
- 对于ASP编码问题的深入研究与最终解决方案
- Android ListView下拉刷新上拉自动加载更多DEMO示例
- JavaScript中的方法调用详细介绍
- 基于jQuery的仿flash的广告轮播代码
- js 加载时自动调整图片大小
- javascript 单选框,多选框美化代码
- 使用javascript实现雪花飘落的效果
- python自动化测试之setUp与tearDown实例
- java利用Apache commons codec进行MD5加密,BASE64加密解密,执行系统命令
- Python中字符串String的基本内置函数与过滤字符模块函数的基本用法
