随笔分类 - winform技术编程
摘要:首先先从System.Windows.Forms.Panel 继承一个自定义控件,然后在控件的构造函数中添加下面的代码 :SetStyle(ControlStyles.UserPaint, true);SetStyle(ControlStyles.SupportsTransparentBackColor, true);this.BackColor = Color.Transparent;其中调用SetStyle函数进行设置ControlStyles.SupportsTransparentBackColor为true 然后设置控件的背景颜色为透明Color.Transparent.把设计好的控件
阅读全文
摘要:Winform实现窗体抖动的效果代码,我们都知道,在目前的即时通讯工具中都有窗体抖动的功能,这也是为了及时通知对方而设立的功能,今天我们就用Winform的C#版来实现窗体拌动的功能!思路:间隔一定时间,改变窗体的位置,必须是围绕起始位置改变窗体位置,否则就成窗体移动了。代码如下:using System;using System.Drawing;using System.Windows.Forms;namespace twitter{ public partial class Form1 : Form { public Form1() { InitializeComponent(); } p
阅读全文
摘要:第一种方法: 用委托,Form2和Form3是同一组 Form2 C#代码 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Text; using System.Windows.Forms; namespace TestMouseMove { public delegate void SetVisiableHandler(); public partial class For...
阅读全文