10 2012 档案

摘要:首先,我们设计好一个BlankApp程序,在添加Button和BlockText控件,在Button中找出Click事件,再单击进入事件。其中xaml中代码显示为: <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <Button x:Name="Folder" Content="Button" HorizontalAlignment="Left" Height="52" Margi 阅读全文
posted @ 2012-10-31 15:27 伍锋 阅读(359) 评论(0) 推荐(0) 编辑
摘要:首先,我们打开VS2012,选择模板BlankApp,填好名字点击进入。在MainPage.xaml中选择一个Button和TextBlock控件。可以在button中选择事件Click。在xaml中代码如下: <Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}"> <Button x:Name="File" Content="Button" HorizontalAlignment="Left" Height 阅读全文
posted @ 2012-10-31 11:12 伍锋 阅读(203) 评论(0) 推荐(0) 编辑
摘要:我上次做的软件的作用就是实现《怎样学习WinForm》的那个例题,它有两个部分,一个是客户端,它的代码如下:View Code using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using System.Threading.Tasks;using System.Windows.Forms;using System.IO;namespace Assig 阅读全文
posted @ 2012-10-08 17:51 伍锋 阅读(348) 评论(0) 推荐(0) 编辑
摘要:如果在同一台电脑上,必须实现两个application间通信时,又不想用UDP和TCP等协议,可以用文本来代替。可以用Timer来巧妙的实现,实现代码既简单又高效。我在程序中设计了两个Timer,第一个用来计算次数,第二个用来接受信息。其中第二个从开始就一直设置为True,例如代码如下: timer2.Enabled = true; 其中第一个Timer代码如下,只要用来设置时间间隔和计量次数,代码如下:private void timer1_Tick(object sender, EventArgs e) { if(time == 1) ... 阅读全文
posted @ 2012-10-08 17:45 伍锋 阅读(3029) 评论(0) 推荐(0) 编辑
摘要:在我上次编写的软件中,很简单实现了再次开始时,能显示上次关闭时的状态,只要就是用数据流将关闭时的状态写入文本中,在再次启动时将信息恢复。其中代码如下: public void btnClose_Click(object sender, EventArgs e) { state = textBox2.Text; bn[0] = btnClose.Enabled; bn[1] = btnStart.Enabled; bn[2] = btnStop.Enabled; bn[3]... 阅读全文
posted @ 2012-10-08 17:34 伍锋 阅读(691) 评论(0) 推荐(0) 编辑
摘要:对于初学者来说,怎样简单应用Winform中的控件,不是一件容易的事。我浅显的讲讲应用,首先双击VS2012--->FILE--->New--->Project--->Windows Forms Application。在Form中可以设计布局了,例如选择工具栏中的Button/Label/TextBox等控件,将其拖入Form中进行设计。我选择上次做的软件来举例。所以软件布局如下: 其中,Label控件就是将想输入的字母写入它的Text属性,然而要想输入&并不容易,就是多写入一个&,例如INC&DEC要在Text属性中写入INC&&am 阅读全文
posted @ 2012-10-08 17:20 伍锋 阅读(202) 评论(0) 推荐(0) 编辑
摘要:怎样制造小画家软件了,怎样实现小画家在互联电脑间显示update了?其实,应用的方法很简单。我们可用Form中的一些事件来浅浅介绍一下:在客户端用上Form中的MouseDown和MouseUp两个事件做出小画家来,通过UDP协议将小画家中信息即时发送去服务端。客户端的代码如下:using System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Linq;using System.Text;using Syst. 阅读全文
posted @ 2012-10-08 16:25 伍锋 阅读(431) 评论(0) 推荐(0) 编辑