Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
C# ПІДРУЧНИКИ / c# / Manning - Windows.forms.programming.with.c#.pdf
Скачиваний:
108
Добавлен:
12.02.2016
Размер:
14.98 Mб
Скачать

16.6RECAP

In this chapter we converted the single document interface, or SDI, application created in part 2 of the book into a multiple document interface, or MDI, application. This amazing feat was done through the creation of a new parent form window and by using members of the Form class and other Windows Forms constructs.

We began by creating the ParentForm class to serve as our MDI container form, and used the existing MainForm object as our child form. We examined the MergeOrder and MergeType properties of the MenuItem class to merge the menus of our parent and child forms into a single menu bar. We created a toolbar on our parent form and integrated the PixelDlg form into the application as well.

From MDI applications we move to the topic of data binding.

RECAP

563

C H A P T E R

1 7

 

 

Data binding

17.1Data grids 565

17.2Data grid customization 573

17.3Editable objects 580

17.4Simple data binding 586

17.5Recap 602

Data binding is a means for associating Windows Forms controls with one or more data sources. We saw a little of this concept in chapter 10 for list controls such as the ListBox and ComboBox classes. These controls provide the DataSource and DataMember properties for binding the list displayed by the control to a specific source of data.

In this chapter we will explore data binding in more detail. While we will keep the discussion focused on Windows Forms classes, many of the examples and discussions carry over to databases and the System.Data namespace where classes such as

DataSet and DataTable are found.

The application in this section will be similar in spirit to the MyAlbumEditor application created in chapters 10 and 11. A ComboBox control will display a list of available albums, and the photographs in the selected album will appear on the remainder of the form. Our new application will be called MyAlbumData and is shown in figure 17.1.

564

Соседние файлы в папке c#