首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Windows表单应用:如何设置表单订单?

Windows表单应用:如何设置表单订单?
EN

Stack Overflow用户
提问于 2011-01-05 13:55:23
回答 1查看 252关注 0票数 1

嗨,

我是Windows窗体应用程序的新手,正在尝试构建一个原型应用程序。我设计了一个数据输入表单,并对业务逻辑进行了编码。现在,我正在尝试从我的欢迎表单中打开数据输入表单。但每次我运行" welcome“表单时,我的数据输入表单都会运行(它是在欢迎表单之前创建的)。我可以在哪里设置表单的执行顺序?

这是form1代码,

代码语言:javascript
复制
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;
using iTextSharp.text;
using iTextSharp.text.pdf;
using System.IO;

namespace PrototypeApp
{
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
    }

    private void button3_Click(object sender, EventArgs e)
    {
        string pdfTemplate = "C:\\app\\End_Of_Project_Client_Evaluation_Template.pdf";
        string newFile = "C:\\app\\End_Of_Project_Client_Evaluation_Template_update.pdf";

        PdfReader reader = new PdfReader(pdfTemplate);
        PdfStamper pdfStamper = new PdfStamper(reader, new FileStream(newFile, FileMode.Create));


        AcroFields fields = pdfStamper.AcroFields;

        fields.SetField("client", txtClient.Text);
        fields.SetField("project", txtProject.Text);
        fields.SetField("project_area", txtArea.Text);
        fields.SetField("project_no", txtLandProjectNo.Text);
        fields.SetField("suggestions", txtSuggestions.Text);
        fields.SetField("project_strength", txtStrengths.Text);
        fields.SetField("other_suggestions", txtComments.Text);


        pdfStamper.FormFlattening = false;

        // close the pdf
        pdfStamper.Close();

        MessageBox.Show("Pdf document successfully updated!!");

    }

}

}

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2011-01-05 14:24:41

在您的解决方案中,有一个名为Program.cs的文件,打开它并更改以下行:

代码语言:javascript
复制
 Application.Run(new Form1());

代码语言:javascript
复制
 Application.Run(new WelcomeForm());

其中WelcomeForm是欢迎UI类的名称。此更改将使您欢迎窗体在您启动应用程序时显示,之后您可以添加一些代码以在需要时启动其他窗体。

票数 2
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/4601223

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档