Building windows forms applications




















The last thing you want to do is waste time digging through the dozens of online form builders that offer many of the same tools for formulating questions, editing themes, and compiling data into reports.

So we've done the hard work for you to find the best tools to build your online forms. Some form software excels at analyzing and exporting the data you collect, while others are designed to make attractive-looking forms with just a few clicks. To help you determine which one is right for you, we tested nearly 30 online form builders and selected the eight best. If you're using forms to collect leads, take a look at how you can automate the process of getting form responses into your other apps to nurture and manage your leads.

How we evaluate and test apps. All of our best apps roundups are written by humans who've spent much of their careers using, testing, and writing about software. We spend dozens of hours researching and testing apps, using each app as it's intended to be used and evaluating it against the criteria we set for the category. We're never paid for placement in our articles from any app or for links to any site—we value the trust readers put in us to offer authentic evaluations of the categories and apps we review.

For more details on our process, read the full rundown of how we select apps to feature on the Zapier blog. You create labels and questions for the pieces of information you're looking to collect, and respondents can provide that information via freeform text boxes, dropdowns, radio buttons, and more. You can also set certain fields as required or optional and restrict the types of responses you receive to have more control over the data you collect.

But although building forms and collecting responses is a straightforward process, form apps come in all shapes and sizes. There are simple, standalone form apps, form builders that are part of a whole productivity suite, and advanced data processing tools that happen to include a form builder. We also focused specifically on online form builders that were platform-neutral. In this article, we wanted to focus on form builders you could use on any platform, so we eliminated those that were designed for a single platform only.

Forms, surveys, and polls are all very similar. If you're not sure which tool is right for your needs, check out our explanation of the difference between the three. Then, if you decide that digital forms aren't exactly what you need, check out our guide to the best survey apps , the best online poll apps , or the best remote data collection apps.

Google Forms Web. Google Forms is an excellent form builder app for many reasons. First, it's entirely free; you just need a Google account to use it. Second, it automatically saves your form results to a Google Sheets spreadsheet for advanced analysis. Finally, it's incredibly fast: adding and editing form fields in the Google Forms editor is noticeably faster than using almost any other online form creator you can even reuse questions previously added to other forms to speed up the process even more.

Google Forms includes all the basic form fields you'd expect. While you can't accept payments, there are options for short- and long-answer text boxes, checkboxes, multiple-choice selections, dropdown menus, file uploads, and more.

You can set questions as required or optional, add images or videos, build a form that acts like a quiz and scores answers, or add some basic conditional logic that adjusts what questions people see based on the answers they provide. Choose from a variety of pre-built templates before populating your form with questions, or customize it when you're finished with basic color and photo themes. You can also add extra fields and features with Google Forms add-ons —something few other form apps offer—and you can share the form with your team to collaborate on it.

Then, with its Google Sheets integration, you can use the power of a spreadsheet to validate your form entries and put your form data to work with customized reports and lists. And from there, you can use the Google Forms Zapier integration to send that data to thousands of other apps.

Here are a couple examples of what you can do:. Want more inspiration for how to automate Google Forms? Take a look at how to power up your Google apps with automation.

Microsoft Forms Web. Microsoft Forms is a Google Forms alternative from Microsoft, and it works largely in the same way, but with more data analysis functionality, thanks to its integration with Excel. Adding questions to Microsoft Forms is fast and simple: add a question, choose the answer format, and type in your questions and response options.

And while Microsoft Forms doesn't offer some of the response types you'll find in Google Forms—it doesn't allow respondents to upload files for certain account types, for example—it does have response types you won't find in Google Forms, like Net Promoter Score.

When you're finished building your form, you can send people a direct link to respond, or you can grab the embed code to add the form to your website or embed it in Sway. Then, get a quick overview of your responses within the Microsoft Forms interface, or open your responses in an Excel spreadsheet to do more detailed digging or visualize your collected data.

Microsoft Forms vs. Google Forms is one thing if you're into spreadsheets—but if you prefer a more advanced database, you might want to consider Airtable's form builder. It works differently than other form builders; instead of building your form first, you start by building a database. Your database collects form responses and lets you take advantage of Airtable's powerful features for organizing, reviewing, and visualizing the data you collect.

Airtable is free for unlimited forms with up to 1, entries per form. Jotform Web, iOS, Android. Jotform lets you build free online forms that do everything you need them to do and look exactly how you want them to look.

That makes a good alternative to Microsoft forms or Google Forms: Jotform's forms are much more customizable than forms created on those apps, and Jotform even lets you do things like accept payments and collect signatures without upgrading to a premium plan. Where Jotform truly stands out is with its immense template library: you can choose from more than 10, form templates that cover everything from contact forms and employment applications to new patient registration forms and market research surveys.

While most services offer at least a few basic templates to get started, most of them still require a substantial amount of customization for what you need. With Jotform, you can almost always find a form that's close to what you need right away. Use those templates, or start with a blank slate, to build single-page or multiple-page forms, including multiple-page forms with each question appearing on its own, separate page.

Then add a logo, build or edit your form using nearly two dozen different types of form fields, set up payment integrations, and take advantage of a variety of widgets that let you do things like collect signatures, validate emails, add a progress bar, and much more. If you need to work in a spreadsheet or create visuals, Jotform makes it easy to do that, too.

And if you don't want to have to look through emails for every response, you can also set up an RSS feed to review your responses in your favorite RSS reader app. When someone responds to your form, you'll receive an email with the responses—or you can use Jotform's Zapier integrations to send the responses to your email marketing tool, spreadsheet app, or anywhere else. You can quickly verify or change the active solution configuration by using the Solution Configurations list on the Standard toolbar.

In the C project, open the ExpenseReportPage. In the ExpenseReportPage method, add the following code: int i;. In the custom constructor Public Sub New The Output window displays the results of the build. The build succeeded, but warnings were generated:. You can temporarily hide certain warning messages during a build rather than have them clutter up the build output.

Choose the Build page and then, in the Suppress warnings box, specify the warning number On the Compile page, select the Disable all warnings check box. For more information, see Configure warnings in Visual Basic. For more information, see How to: Suppress compiler warnings.

You can change how much information about the build process appears in the Output window. Build verbosity is usually set to Minimal , which means that the Output window displays only a summary of the build process along with any high priority warnings or errors. You can display more information about the build by using the Options dialog box, Projects and Solutions, Build and Run.

Choose the Projects and Solutions category, and then choose the Build and Run page. The build information includes the time that the build started located at the beginning and the order in which files were processed. This information also includes the actual compiler syntax that Visual Studio runs during the build. For more information, see How to: View, save, and configure build log files.

Contrast can also attract attention to important elements of your application. Usability should determine the fonts you choose for your application.

For usability, avoid fonts that are difficult to read or highly embellished. Stick to simple, easy-to-read fonts such as Palatino or Times New Roman. Also, as with other design elements, fonts should be applied consistently throughout the application.

Use cursive or decorative fonts only for visual effects, such as on a title page if appropriate, and never to convey important information. Pictures and icons add visual interest to your application, but careful design is essential to their use. Images that appear "busy" or that distract the user will hinder use of your application. Icons can convey information, but again, careful consideration of end-user response is required before deciding on their use.

For example, you might consider using a red octagon similar to a U. Whenever possible, icons should be kept to simple shapes that are easily rendered in a bypixel square. This will open the Visual Studio Start Page. Now you will see the New Project dialog box from which you can choose the Windows Forms Application template, as shown in Figure Figure Choosing the Windows Forms Application project template.

You can enter another name for your project in the Name text box when you choose the project template, or you can rename your project later. Once you have chosen the Windows Forms Application template and desired name and location, click "OK". This will open the Visual Studio Integrated Development Environment IDE , called such because it has all the development-related tools, windows, dialog boxes, options, and so forth, embedded or integrated inside one common window, that makes the development process easier.

You also need to understand one more window called the Properties window. Now the development environment will look like Figure Because this is a Windows Forms Application project, you will be working with controls or tools that allow you to provide functionality in the form of a GUI. You can pick the controls from the Toolbox, shown on the left side of the Windows Forms form in the development environment.

If you hover your mouse pointer on the Toolbox tab then the Toolbox window will open; expand the All Windows Forms tool set, as shown in Figure You can pick controls from there and drop them onto the surface of the Windows Forms form. IDE with the Toolbox. The Design View allows you to drag controls and drop them onto the form.

You can use the Properties window to set the properties of objects and forms or other files shown in the Solution Explorer. The Solution Explorer also allows you to rename the project, forms, or even other files included in the project. You can rename these objects by selecting them, right-clicking, and selecting "Rename" from the context menu. Basically, the Design View gives you a visual way to work with the controls, objects, project files, and so forth.

You'll want to use the other view available in the Visual Studio IDE, the Code View, when you are working with code to implement the functionality behind the visual controls sitting on the surface of your Windows Forms forms.

Either method will open the Code View for you, as shown in Figure The Code View. The Code View displays all the code functionality.

In Figure , note the Form1. Interestingly, if you tried accessing the Toolbox while in the Code View, you will see that there are no controls in the Toolbox. But when you switch back to the Design View, you'll find the Toolbox is fully loaded with the controls.

To switch back to the Design View, right-click the form in the Code View and select View Designer; you will see that now you are back to the Design View and can continue working with the visual elements, or controls.

You can also use Solution Explorer to switch among the Design and Code Views by selecting your desired Windows Forms form in case you have multiple Windows Forms forms open , right-clicking, and choosing either View Code or View Designer.

Each object such as a form control has many properties you may need to set while working with an application. To help you navigate the many properties listed in the Properties window, you can sort them either categorically or alphabetically.

Let's look at each of these sorting options. The Categorized View organizes properties in the form of sets of properties, and each set has a name to describe that collection of properties; for example, there are categories named Appearance, Behavior, Data, Design, Focus, and so on.

You can switch to the Categorized View by clicking the icon on the very left of the toolbar shown at the top of the Properties window.

In Figure, which shows the Categorized View, under the Appearance category, you will see all properties listed that define the look and feel of the object in this case, a form.

Note that the other categories are also shown in Figure Note: I have intentionally kept the other categories in the collapsed mode in Figure , just to show you all the categories. When you switch to the Categorized View, you will see that all the categories are expanded by default.

Categorized View of properties. The Alphabetical View organizes properties in ascending order by name from a to z. You can switch to the Alphabetical View by clicking the icon second from the left on the toolbar shown in the top of the Properties window. Figure shows this view; all the properties listed are organized alphabetically.

Working with the Alphabetical View, rather than the Categorized View, makes life much easier. For example, say you are seeking the Font property. In the Categorized View, you need to understand under which category this property is located to find it.

However, if you have properties organized in the Alphabetical View, you can easily locate this property because it begins with the letter F, so you know whether you need to go back or forward to find this property for your control. Alphabetical View of properties. Before you begin putting controls onto the Windows Forms form, you need to learn how to modify some property values of the solution, project, and form you created earlier shown previously in Figure Note : In some cases you may not be able to see the solution.

Select the "WindowsFormsApplication1" project in Solution Explorer, go to the Properties window, and modify the Project File property value, that defines the file name of the project, to appear as "WinApp. Now change the name of the Windows Forms form: select "Form1. Now click "Form1", located in the Solution Explorer window. Once Form1 is selected, you will see that the list of properties has changed in the Properties window.

Select the Text property and modify its value from "Form1" to "Windows Application". The Text property defines the name shown on the title bar of the form. IDE after setting the properties for your solution, project, and Windows Forms form. Now that you have your Windows Forms application in place, you can start working with the controls.

The basic element of any Windows application is the control, that plays a key role by providing the visual meaning of the code functionality embedded in an application. Applications cannot exist without these controls, so you'll see how you can incorporate some of them into your application.

In this exercise, you'll create a Windows Forms application with three labels, two text boxes, and a button. The application will accept your name as input and then flash a "Welcome" message in the form of a dialog box. Tip : You can also double-click any control in the Toolbox to add it to the form. The difference between dragging a control and double-clicking is that while dragging, you can position the control as you desire on the form. But if you just double-click a control then it will be added to the top-left corner; therefore, if you prefer it in a different location then you still need to drag it to there.

It's time to add functionality and switch to the Code View. You will obtain the First Name and Last Name values supplied by the user and flash a message on a click of the Submit button, which means you need to put all the functionality behind the Submit button's click event, that will eventually read the values from the TextBox controls. To do this, continue with the following procedure. Double-click the Submit button.

This will take you to the Code View, and you will see that the btnSubmitClick event template has been added to the code. Now you will add the code to show a dialog box, with a greeting and welcome message for the first name and last name that were entered. To do so, you will use the MessageBox class; this class provides a Show function to display a dialog box with the provided information. Now let's add the following code inside this btnSubmitClick event to do the desired functionality of a dialog, with a message, a caption in the dialog box's title bar, an OK button, a Cancel button, and an information icon displayed:.

Information ;. Now your Code View will show the button's click event code, as shown in Figure Code View of your Button click event with MessageBox. Now it's time to run and test the application. Visual Studio will load the application. Enter values in the First Name and Last Name text boxes, and then click the Submit button; you will see a message similar to the one shown in Figure Running the Windows Application form. Visual Studio comes with many features to help developers while writing code.

One of these features is that you can just double-click the GUI element for which you want to add the code, and you will be taken to the code associated with the GUI element in the Code View.

For example, when you double-click the Submit button in the Design View, you are taken to the Code View, and the btnSubmitClick event template is automatically generated. To provide the functionality for this control, you add the following code:.

Show " is a. NET Windows Forms method that pops up a message box based on the arguments provided. To display a "Welcome" message with the first name and last name specified by the user in the message box, you apply a string concatenation approach when writing the code. In the code segment, you hard-code the message "Hello Welcome to the Windows Application," but with the first name and last name of the user appearing after the word Hello and concatenated with the rest of the message, "Welcome to the Windows Application.

If you do not include the single space character '' during string concatenation, the words will be run into each other, and the message displayed in the message box will be difficult to read. The second parameter you are provided with is Caption, which is the title of the dialog. We hard-coded this as "Welcome," and then we chose our button set through "MessageBoxButtons. The final argument we passed is "MessageBoxIcon" and used an information type icon.

Note : "MessageBox. Show " is a very powerful and handy function; you may want to play a little more with various choices that IntelliSense shows for the "MessageBoxButtons" and "MessageBoxIcon" type arguments. For instance, if you had some controls on the left side of a form and you tried to resize the form by stretching it toward the right side or bringing it back toward the left, the controls wouldn't readjust themselves according to the width of the resized form.

Developers were bound to write code to shift controls accordingly to account for the user resizing the form. This technique was very code heavy and not so easy to implement. With Visual Studio and onwards came two new properties, Anchor and Dock, that are easy to set at design time.

The same Dock and Anchor properties are available with Visual Studio , and they solve the problem with the behavior of controls that users face while resizing forms. The Dock property allows you to attach a control to one of the edges of its parent. The term parent applies to Windows Forms forms, because Windows Forms forms contain the controls that you drag and drop on them.

By default, the Dock property of any control is set to None.



0コメント

  • 1000 / 1000