WinForm program development interface parameter transfer, winform Program Development
1.
[Csharp]View plaincopy
- 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;
- Namespace WindowsFormsApplication2
- {
- Public partial class Form1: Form
- {
- Public Form1 ()
- {
- InitializeComponent ();
- }
- Private void ButtonClickMethod (object sender, EventArgs e)
- {
- This. nextForm = new Form2 (this );
- This. nextForm. Show ();
- }
- Private Form2 nextForm;
- Private void checkbox#click (object sender, EventArgs e)
- {
- This. nextForm. Close ();
- }
- }
- }
2.
[Csharp]View plaincopy
- 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;
- Namespace WindowsFormsApplication2
- {
- Public partial class Form2: Form
- {
- Public Form2 (Form1 f)
- {
- This. prevForm = f;
- InitializeComponent ();
- }
- Private Form1 prevForm;
- Private void button#click (object sender, EventArgs e)
- {
- }
- }
- }
I am working on a winform program. I want to pass parameters (POST method) to a page of a web program and open this webpage.
Add a webbrowser control to winform
Then use webrequest
HttpWebRequest request = (HttpWebRequest) HttpWebRequest. Create (requestURL );
Request. Method = "POST ";
UTF8Encoding encoding = new UTF8Encoding ();
Byte [] data = encoding. GetBytes (PostString );
Request. ContentType = "application/x-www-form-urlencoded ";
Request. ContentLength = data. Length;
Stream stream = request. GetRequestStream ();
After obtaining the returned stream
Just send the DocumentStream to webbrowser.
How does XtraReport automatically bind Dataset to PASS Parameters for DataSet and display the best source program on the winform page?
It is easy to pass the parameter. You can use an overloaded constructor or define a public attribute, and then XtraReport rpt = new XtraReport (); rpt. property = XXX; rpt. createReport (); On winform, you can drag and drop a reportviewer control on form, which is very simple.