方法有很多种,这里介绍项目中使用的两种 一.通过委托+事件的方法进行传值 (点击Form2中的button1按钮,将会把Form2中的textbox.text 传给Form1中的 lable.text) 先上效果图 以下是代码 public partial class Form2 : Form { public Form2() { InitializeComponent(); } public delegate void SendDataInvoke(string value); public
1.客户端一个http连接包含两个方向,一个是这个http连接的输入,另一个是这个http连接的输出. 利用httpclient进行ip地址和端口号连接后,http的输出端作为http请求参数设置.http输出端用于http请求设置. http输入端,用于接收服务端传回来的数据. 其中有个关键的http.openConencetion()方法来启动连接.和httpConn.getInputStream()用于接收服务器端返回的数据. .客户端获取json字符串 public class Http
只要将要被潜逃的的窗体的TopLeve设置为Flase即可像普通的控件一样,被添加到另外一个窗体中,TopLeve:是否为顶级窗口,下面来看代码: public partial class TTForm : Form { public TTForm() { InitializeComponent(); weiboOfSina weibo = new weiboOfSina(); weibo.Dock = DockStyle.Fill; weibo.FormBorderStyle = FormBo
C#应用编程小例子-03-展示另一个窗体 using System; using System.Collections.Generic; using System.ComponentModel; using System.Data; using System.Drawing; using System.Linq; using System.Text; using System.Windows.Forms; namespace Ex02 { public partial class Form1 :