Creating a User Control

In this section you'll create a user control and then add Windows Forms controls for selecting graphics and entering text. A user control acts as a container for all the Windows Forms controls that you add to it. You

Figure 8.11. Adding a table to a header

can then programmatically add the user control to a Windows Form that you'll display when the user clicks the Create button on the Logo menu. Theoretically, you could design a Windows Form simply by adding controls directly to it, but we're choosing to use a user control so that you can see how this control can be reused on the Document Actions task pane in the next section of this chapter. For an example of how to convert a Windows Form to a user control, see Chapter 12.

The first step is to save some graphics to a folder so that you can display them on the Windows Form and also insert the selected graphic into the document header. The next step is to add a user control to your project. Then you'll add a number of controls to the user control.

0 0

Post a comment