本文共 1032 字,大约阅读时间需要 3 分钟。
Handling Multiple Control Action Events
This sample demonstrates how to handle multiple control action events raised from different ASP:Button controls. The code provided includes event handlers for Add, AddAll, Remove, and RemoveAll actions. These handlers allow for efficient management of font installations by transferring data between two list boxes: AvailableFonts and InstalledFonts.
The AddBtn_Click method checks if a font is selected and then adds it to the InstalledFonts list while removing it from AvailableFonts. The AddAllBtn_Click method repeatedly transfers the first item from AvailableFonts to InstalledFonts until no items remain in AvailableFonts. Similarly, the RemoveBtn_Click method removes the selected font from InstalledFonts and adds it to AvailableFonts, while the RemoveAllBtn_Click method clears all fonts from InstalledFonts.
These event handlers provide a straightforward way to synchronize font installations between the two list boxes, ensuring that users can easily add or remove fonts as needed.
转载地址:http://xzufk.baihongyu.com/