WinForm program development interface parameter transfer, winform Program Development

Source: Internet
Author: User

WinForm program development interface parameter transfer, winform Program Development

1.

[Csharp]View plaincopy
  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. Namespace WindowsFormsApplication2
  11. {
  12. Public partial class Form1: Form
  13. {
  14. Public Form1 ()
  15. {
  16. InitializeComponent ();
  17. }
  18. Private void ButtonClickMethod (object sender, EventArgs e)
  19. {
  20. This. nextForm = new Form2 (this );
  21. This. nextForm. Show ();
  22. }
  23. Private Form2 nextForm;
  24. Private void checkbox#click (object sender, EventArgs e)
  25. {
  26. This. nextForm. Close ();
  27. }
  28. }
  29. }

2.

[Csharp]View plaincopy
  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. Namespace WindowsFormsApplication2
  11. {
  12. Public partial class Form2: Form
  13. {
  14. Public Form2 (Form1 f)
  15. {
  16. This. prevForm = f;
  17. InitializeComponent ();
  18. }
  19. Private Form1 prevForm;
  20. Private void button#click (object sender, EventArgs e)
  21. {
  22. }
  23. }
  24. }

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.
 

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.