VS2012窗口操作简单演示

呵呵,终于进入到我感兴趣的窗口方面的操作啦。。

三个窗口的SHOW和HIDE。。。

PROGRAM.CS中记录第一个加载的窗口FORM

using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WindowsFormsApplication1
{
    static class Program
    {
        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new Form1());
        }
    }
}

FORM1.CS的主要代码如下:

 1 using System;
 2 using System.Collections.Generic;
 3 using System.ComponentModel;
 4 using System.Data;
 5 using System.Drawing;
 6 using System.Linq;
 7 using System.Text;
 8 using System.Threading.Tasks;
 9 using System.Windows.Forms;
10
11 namespace WindowsFormsApplication1
12 {
13     public partial class Form1 : Form
14     {
15         public Form1()
16         {
17             InitializeComponent();
18         }
19
20         private void label1_Click(object sender, EventArgs e)
21         {
22
23         }
24
25         private void button1_Click(object sender, EventArgs e)
26         {
27             Form2 frm2 = new Form2();
28             frm2.Show();
29         }
30
31         private void button2_Click(object sender, EventArgs e)
32         {
33             Form3 frm3 = new Form3();
34             frm3.Show();
35         }
36
37         private void Form1_Load(object sender, EventArgs e)
38         {
39         }
40     }
41 }

至于下面这个代友乾坤,以后要慢慢研究的。

好像不建议手工更改,都是通过界面设置属性的。

 1 namespace WindowsFormsApplication1
 2 {
 3     partial class Form1
 4     {
 5         /// <summary>
 6         /// Required designer variable.
 7         /// </summary>
 8         private System.ComponentModel.IContainer components = null;
 9
10         /// <summary>
11         /// Clean up any resources being used.
12         /// </summary>
13         /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
14         protected override void Dispose(bool disposing)
15         {
16             if (disposing && (components != null))
17             {
18                 components.Dispose();
19             }
20             base.Dispose(disposing);
21         }
22
23         #region Windows Form Designer generated code
24
25         /// <summary>
26         /// Required method for Designer support - do not modify
27         /// the contents of this method with the code editor.
28         /// </summary>
29         private void InitializeComponent()
30         {
31             this.button1 = new System.Windows.Forms.Button();
32             this.button2 = new System.Windows.Forms.Button();
33             this.label1 = new System.Windows.Forms.Label();
34             this.SuspendLayout();
35             //
36             // button1
37             //
38             this.button1.Location = new System.Drawing.Point(118, 260);
39             this.button1.Name = "button1";
40             this.button1.Size = new System.Drawing.Size(75, 23);
41             this.button1.TabIndex = 0;
42             this.button1.Text = "第一本";
43             this.button1.UseVisualStyleBackColor = true;
44             this.button1.Click += new System.EventHandler(this.button1_Click);
45             //
46             // button2
47             //
48             this.button2.Location = new System.Drawing.Point(258, 260);
49             this.button2.Name = "button2";
50             this.button2.Size = new System.Drawing.Size(75, 23);
51             this.button2.TabIndex = 1;
52             this.button2.Text = "第二本";
53             this.button2.UseVisualStyleBackColor = true;
54             this.button2.Click += new System.EventHandler(this.button2_Click);
55             //
56             // label1
57             //
58             this.label1.AutoSize = true;
59             this.label1.Font = new System.Drawing.Font("Adobe Arabic", 24F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(134)));
60             this.label1.Location = new System.Drawing.Point(92, 205);
61             this.label1.Name = "label1";
62             this.label1.Size = new System.Drawing.Size(303, 33);
63             this.label1.TabIndex = 2;
64             this.label1.Text = "最近看的计算机图书";
65             this.label1.Click += new System.EventHandler(this.label1_Click);
66             //
67             // Form1
68             //
69             this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
70             this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
71             this.BackColor = System.Drawing.SystemColors.HotTrack;
72             this.ClientSize = new System.Drawing.Size(449, 505);
73             this.Controls.Add(this.label1);
74             this.Controls.Add(this.button2);
75             this.Controls.Add(this.button1);
76             this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog;
77             this.Name = "Form1";
78             this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
79             this.Text = "窗体操作简单演示";
80             this.Load += new System.EventHandler(this.Form1_Load);
81             this.ResumeLayout(false);
82             this.PerformLayout();
83
84         }
85
86         #endregion
87
88         private System.Windows.Forms.Button button1;
89         private System.Windows.Forms.Button button2;
90         private System.Windows.Forms.Label label1;
91     }
92 }

效果图:

 

时间: 2024-07-31 08:32:53

VS2012窗口操作简单演示的相关文章

Rman操作简单分析

http://www.itpub.net/245264.html Rman操作简单分析 在我的上一篇文章中为大家演示了rman 备份恢复的一个特定例子.(参考:http://www.dbanotes.net/Oracle/Rman...lfile_howto.htm)rman 对dbms_backup.restore 的一些特定调用完梢酝üebug 分析出来.通过设置debug 模式,我们可以跟踪到大量的Log,从而为分析提供一定的说明.假定我们提交如下的命令:rman target /

MFC中CWnd类及其派生类对话框、消息处理、窗口操作

http://hi.baidu.com/xiaorida21/blog/item/8d8eb77a22eedee52e73b39e.html CWnd类 我们在屏幕上看到的所有对象都和窗口有关,它们或者派生于CWnd,属继承关系,如对话框.工具栏.状态栏.子控件:或者被CWnd合成,属服务员与服务对象关系,如图标.菜单.显示设备. CWnd类封装的窗口操作主要包含窗口的创建和销毁.操作窗口风格.操作窗口状态.窗口子类化.获取指定窗口等. 当然,CWnd还实现了其他功能: 1.绘制窗口 GetDC

jQuery实现Tab选项卡切换效果简单演示_jquery

本文实例针对jQuery实现Tab选项卡切换效果进行了简单演示,完全是自己的思考实现过程,分享给大家供大家参考.具体如下: 起初我Html代码架子是这样的: <div class="tabs"> <ul> <li class="acss" data-box="#panel-1">标签1</li> <li class="bcss" data-box="#panel-

Oracle 数据库针对表主键列并发导致行级锁简单演示_oracle

本文内容 •软件环境 •简单演示 Oracle 数据库并发导致行级锁 本文简单演示针对表主键并发导致的行级锁.并发是两个以上的用户对同样的数据进行修改(包括插入.删除和修改).锁的产生是因为并发.没有并发,就没有锁.并发的产生是因为系统需要,系统需要是因为用户需要. 软件环境 -------------------------------------------------------------------------------- •Windows 2003 Server •Oracle 1

[20150409]vim的多窗口操作.txt

[20150409]vim的多窗口操作.txt --工作看代码的需要,需要多窗口操作,我以前喜欢使用tab功能. --比如1个文件,要打开新的tab执行: :tabedit % --执行前保存就可以执行以上命令,使用gt来切换.或者是ctrl+ 或者ctrl+切换. --但是这样看程序代码切换不是很方面. --下午抽一点时间看看多窗口操作,我的需求很简单. :sp     水平分割窗口 :vsp    垂直分割窗口 +s 水平分割窗口 +v 垂直分割窗口 +w 切换窗口,实际上这个鼠标就可以了.

C语言控制台窗口图形界面编程之二 用于控制台窗口操作的API函数

下面介绍几个用于控制台窗口操作的API函数,如下: //获取控制台窗口信息 GetConsoleScreenBufferInfo(); //获取控制台窗口标题 GetConsoleTitle(); //更改指定缓冲区大小 SetConsoleScreenBufferSize(); //设置控制台窗口标题 SetConsoleTitle(); //设置控制台窗口信息 SetConsoleWindowInfo(); 下面的示例程序用于说明此类函数的使用: #include <stdio.h> #i

PHP使用模板制作静态页面简单演示

简单演示PHP如何使用模板生成静态页面. 模板文件templets.htm: <html> <head> <title>{title}</title> </head> <body> <p>Hello {hello}</p> </body> </html> PHP文件代码: <?php $title = 'bianceng.cn' ; $hello = 'www.bianceng.c

动态-线性表、树、图的操作和演示

问题描述 线性表.树.图的操作和演示 那个动态演示怎么弄 啊.以动画形式演示在其上的插入.查找.删除等操作. 解决方案 是不是数据结构课件中的演示~~~ 解决方案二: 动画?也就是说不是编程来实现动画,可以考虑动画制作软件来实现.

jQuery实现选项卡切换效果简单演示_jquery

本文实例讲述了jQuery实现选项卡切换效果简单演示代码.分享给大家供大家参考.具体如下: 运行效果图如下 一.主体程序 <!DOCTYPE html> <html> <head> <meta charset="utf-8" /> <title>选项卡</title> <link type="text/css" rel="stylesheet" href="c