MULTIPIK Trovadore's Home Trattoria Form1 Label1 ,Pick up to 5 of these mouth watering dishes: DummyList System OKCancel System OKCancel &Cancel System iflag wMulPik IDL_MPICK @ Form_Load TRUE< Form_Paint hInst GetWindowWord MULTIPIK GWW_HINSTANCE GetWindowRect DummyListP GetFocus< Visible FALSEN GetSystemMetrics SM_CYCAPTION| nWidth right nHeight BOTTOM CreateWindowt LBS_MULTIPICK IDL_MPIK HideMe ShowWindow SendDlgItemMessage LB_ADDSTRING ShowMe OKCancel_Click Index Total LB_GETSELCOUNTW Count Choices LB_GETSELITEMS LB_GETTEXT Notice Thanks Caption SW_HIDE SW_SHOWJ Feel free to use or modify MULTIPIK to suit your needss Address questions/comments/improvements tot Costas Kitsos, CIS ID: 73667,1755 Enjoy! Flag used during the creation of the MultiPick ListBox_ Window handle for the MultiPick ListBox We'll assing this ID number to the MultiPick ListBox. Since VB assignsU ID numbers sequentially starting with 1, this number is high enough not to cause conflicts with any Controls on our form. Form_Load Set the flag to TRUE to inform Form_Paint to create the MultiPick ListBox Form_Paint Get the Instance handle to MULTIPIK. We need this for the CreateWindow function.e Get the dimensions of the formT Get the dimensions of the Dummy ListBox Calculate the size and placement of the MultiPick ListBox based on the size and placement of the Form and the Dummy ListBox.s Create the MultiPick ListBox lpClassName: we'll use the LISTBOX classd lpWindowName: is irrelevant hereO dwStyle: the MultiPick styleh X, Y, nWidth, nHeight: size and placement of the MultiPick ListBoxL hWndParent: this would be our MULTIPIK hWnd hMenu: would be IDL_MPICK hInstance: we've already determined thatW lpParam: is irrelevant here LISTBOX" hide the MultiPick ListBox we've just created so the screen doesn't flicker when we add our items Add the items to the ListBoxs Linguine with Italian Sausage and Green Peppers" Capellini with Shitake Mushrooms in Cream Sauce Spinach Fettucine with Zucchini and Pesto Sauce" Rigatoni with Shrimp Areganata Vermicelli with Sun Dried Tomatoes Veal Marsala with Prosciutto Ham Linguine Carbonara Con Pancetta" Grilled Salmon in Tomato-Taragon Butter" Linguine with Fresh Clams and Scallions" Homemade Lasagna Fiorentina" Penne with Asparagus and Italian Bacon Rosemary Chicken with Japanese Eggplant" Angel Hair with Sun Dried Tomatoes Concasse" Three Citrus Grilled Chicken Shrimp Scampi and Penne Possilippo Veal Vesuvio with Fresh Vegetables Capellini Calamari tossed in Garlic Oil" Chicken Marsala" Tagliatelle with Veal in Sesame Sauce" Linguine with Fresh Vegetables Con Primavera Fettucine Alfredo" Spaghetti Aglio e Olio Show the MultiPick ListBox Set the flag to FALSE so we don't go through this again OKCancel_Click If the user pressed ENTER or clicked on OK, get the total items picked For the purposes of this demo let's limit the total to 5l Dimension an Array of Integer to hold the indices of the items picked Dimension a String Array to hold the selected items Get the selections from the MultiPick ListBox, and copy themm to the Dish Array removing ASCII 0s.k Prove that it worked Thank you for preferring Trovadore's!" We're done If the user chose Cancel or pressed ESCAPE, exit"