随笔分类 -  C#语言

C#实现无标题窗体拖动方法封装提取及应用
摘要:方法封装提取代码如下:using System;using System.Collections.Generic;using System.Text;//Pointusing System.Drawing;//DllImportusing System.Runtime.InteropServices;//MouseEventArgsusing System.Windows.Forms;namespace FinancialManage.com.smile{ public class SmilePublicLibrary { #region 鼠标拖动控件或窗体,实现窗体... 阅读全文

posted @ 2012-09-27 01:25 poir

在关闭主窗体时,同时关闭隐藏的窗体
摘要:在关闭主窗体时,如果存在隐藏的窗体,那么,关闭了主窗体,隐藏的窗体还没有真正关闭。故,需要做相应的处理。以下以登录为例:示例说明:用户登录后,登录窗体为隐藏窗体,打开主窗体。在直接点击窗体右上角的关闭按钮时,登录窗体默认还没有关闭,程序还在运行。故需要添加主窗体的FormClosed事件,代码如下:private void FinancialManage_FormClosed(object sender, FormClosedEventArgs e) { //退出程序 Application.Exit(); } 阅读全文

posted @ 2012-09-26 19:15 poir 阅读(243) 评论(0) 推荐(0)

C#WinForm编程中窗体传值
摘要:一、使用构造函数传值步骤一、修改子窗体(FinancialManage)中的默认构造函数 public FinancialManage(string inputstr) { InitializeComponent(); this.textBox1.Text = inputstr;//inputstr数据将显示在textBox1中 }步骤二、在父窗体中调用 FinancialManage fm = new FinancialManage(user); fm.Show();如果要传的数据量比较大点的,可以采用类(UserEnt... 阅读全文

posted @ 2012-09-26 16:38 poir 阅读(130) 评论(0) 推荐(0)

导航