To create a CListView: I - The raw stuff: 1. Start Visual Studio if you didn't yet. a) Press Ctrl+N to invoke the File->New dialog. b) From the New dialog, in the Files tab, choose MFC AppWizard(exe). Type the File name as ListViewExo. In the Location box, specify the directory where you want to create your exo. After checking that the platform is specified as Win 32 (which is by default), press OK. c) In MFC AppWizard Step 1 of 1, choose Single Document (SDI). d) Accept all other defaults in Steps 2, 3, 4. e) In MFC AppWizard Step 5, refuse the Comments. f) In MFC AppWizard Step 6, base your CListViewExo on the CListView class. Press Enter. g) The New Project Information presents a preamble to you to examine and accept or modify. Press Enter to accept. 2. In the Visual Studio interface, from the main menu, click Build->Set Active Configuration... Double-click ListViewExo - Win32 Release. 3. Let's create the ListView resource. a) From the main menu, click Insert->Resource... In the Resource dialog, double-click Bitmap. b) From the WorkSpace, in the ResouceView tab, right-click on the IDB_BITMAP1 and choose Properties. Click the PushPin button on the Properties dialog to always have it on top. Change the identifier of the bitmap to IDB_LARGEIMAGE. Create a bitmap with dimensions X * 32; 32 represents the height of each image, X = a * 32 where a represents the number of items or columns that will be displayed, X represents the the total Width of the bitmap including all the items. For this exercise, we will use a width of 320 and a height of 32. That gives us space for 10 images.
Webmaster | Copyright (c) 1999 FunctionX |