学习.NET Winform开发 - 演示System.Windows.Forms.Form类的使用

学习.NET Winform开发 - 展示System.Windows.Forms.Form类的使用

撰写日期:2016/04/20
更新日期:2016/04/22
发布地址:http://www.cnblogs.com/gibbonnet/p/5417191.html

任务场景

基本操作

  • 标题 Form.Text
  • 大小 Form.Size
  • 位置 Form.StartPosition
  • 图标 Form.Icon
  • 总是最前 Form.TopMost

进阶操作

  • 最小化至任务栏 System.Windows.Forms.NotifyIcon
  • 文件拖拽动作支持 Form.AllowDrop, DragOver, DragDrop

DemoForm.cs

效果:

编译: csc DemoForm.cs /target:winexe /win32icon:images/title.ico

基本操作源码

using System;
using System.ComponentModel;
using System.Drawing;
using System.Windows.Forms;

/**
 * DemoForm.cs
    - 标题
    - 大小
    - 位置
    - 图标
 * csc DemoForm.cs /target:winexe /win32icon:images/title.ico 
 */
namespace gibbon.learning.winform
{
    public class DemoForm : Form
    {
        public DemoForm()
        {
            // set caption
            this.Text = "窗口的标题";
            // CenterParent, CenterScreen, Manual, WindowsDefaultBounds, WindowsDefaultLocation
            this.StartPosition = FormStartPosition.CenterScreen;
            // weight, height
            this.Size = new Size(500, 600);
            // icon
            this.Icon = new System.Drawing.Icon("images/Title.ico"
  • 0
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值