摘要: using System;using System.Windows.Forms;using System.Runtime.InteropServices;//窗体效果需要该包 namespace 软件项目管理系统{ public partial class LoginForm : Form { // 阅读全文
posted @ 2017-08-30 09:43 viu 阅读(396) 评论(0) 推荐(0) 编辑
摘要: private void Form1_Load(object sender, EventArgs e) { RegistryKey reg = Registry.CurrentUser.CreateSubKey("SoftWare\\MySoft"); int x = Convert.ToInt32 阅读全文
posted @ 2017-08-30 09:41 viu 阅读(422) 评论(0) 推荐(0) 编辑
摘要: 把Form的KeyPreview设为true然后设置KeyDown,KeyUp或KeyPress事件。在KeyDown事件中截获。private void textBox1_KeyDown(object sender, KeyEventArgs e){ if (e.KeyCode == Keys.E 阅读全文
posted @ 2017-08-30 09:39 viu 阅读(930) 评论(0) 推荐(0) 编辑
摘要: private const int WS_HSCROLL = 0x100000; private const int WS_VSCROLL = 0x200000; private const int GWL_STYLE = (-16); [System.Runtime.InteropServices 阅读全文
posted @ 2017-08-30 09:37 viu 阅读(1024) 评论(0) 推荐(1) 编辑
摘要: //设置对话框的过滤条件 ofdSelectPic.Filter = "png文件(*.png)|*.png|jpg 文件(*.jpg)|*.jpg|所有文件(*.*)|*.*"; ofdSelectPic.Title = "打开图片"; ofdSelectPic.FilterIndex = 2; 阅读全文
posted @ 2017-08-30 09:36 viu 阅读(2436) 评论(1) 推荐(0) 编辑
摘要: Demo: 现有一PictureBox控件,十多个Label以及Button,那么只将这些Label和Button放入Panel中。同时在Form_Load事件中加入如下代码即可实现背景透明: this.picturebox1.SendToBack();//将背景图片放到最下面 this.panel 阅读全文
posted @ 2017-08-25 17:57 viu 阅读(920) 评论(0) 推荐(0) 编辑
摘要: 1.要实现C# WinForm中的控件与背景的透明,可以通过设置控件的BackColor属性为Transparent,同时设置其父控件。因为在C#中,控件的透明指对父窗体透明。如果不设置Parent属性,那么控件将只对Form透明,显示的时候都会把Form的背景色(默认为Control)重刷一遍作为 阅读全文
posted @ 2017-08-25 17:55 viu 阅读(1987) 评论(0) 推荐(0) 编辑
摘要: lbl.TextAlign = ContentAlignment.BottomCenter; 阅读全文
posted @ 2017-08-25 17:51 viu 阅读(1282) 评论(0) 推荐(0) 编辑
摘要: 1、 新建一个简单的 windows 应用项目 在默认的 Form1 中添加如下控件: 1) Label : text = “ 输入验证码 :” 2) TextBox : name=” txtValidCode” 输入验证码的文本框 3) Image : name=” picValidCode” 显 阅读全文
posted @ 2017-08-25 17:50 viu 阅读(4527) 评论(0) 推荐(0) 编辑