TAILIEUCHUNG - Adding Menus and Processing Menu Events

Thêm Menus và chế biến Menu Sự kiện Microsoft Visual Studio 2005 cho phép bạn thêm các trình đơn và các mục trình đơn mẫu theo hai cách. Bạn có thể sử dụng Visual Studio 2005 tích hợp môi trường phát triển (IDE) và biên tập các trình đơn để tạo ra một menu đồ họa. | Adding Menus and Processing Menu Events Microsoft Visual Studio 2005 lets you add menus and menu items to a form in two ways. You can use the Visual Studio 2005 integrated development environment IDE and the menu editor to create a menu graphically. You can also write code that creates a MenuStrip object MenuStrip is a class defined in the Windows Forms library and then add ToolStripMenultem objects to it ToolStripMenultem is another class in the Windows Forms library . Laying out a menu is only half of the story. When a user clicks a command on a menu the user expects something to happen You activate the commands by trapping menu events and executing code in much the same way as you do for handling control events. Creating a Menu In the following exercise you will use the graphical approach to create menus for the Middleshire Bell Ringers Association application. We will cover how to manipulate and create menus programmatically later in this chapter. Create the File menu 1. Start Visual Studio 2005. 2. Open the BellRingers project located in the Microsoft Press Visual CSharp Step by Step Chapter 21 BellRingers folder in your My Documents folder. This is the Middleshire Bell Ringers application. It should be the same as the version that you completed in Chapter 20. 3. Display MemberForm in the Design View window. Click in the Solution Explorer and then click Designer on the View menu or double-click in the Solution Explorer . MemberForm appears. 4. In the Toolbox expand the Menus Toolbars category. Drag a MenuStrip control anywhere onto MemberForm. IMPORTANT Be sure to drop the MenuStrip control onto the form and not onto a control on the form. Some controls such as GroupBox can have their own menus and dropping a menu on such a control will create a menu for that control only. The control by default called menuStripl appears at the bottom of the form and a menu strip containing the caption Type Here is added to the top of the form. 5. .

TAILIEUCHUNG - Chia sẻ tài liệu không giới hạn
Địa chỉ : 444 Hoang Hoa Tham, Hanoi, Viet Nam
Website : tailieuchung.com
Email : tailieuchung20@gmail.com
Tailieuchung.com là thư viện tài liệu trực tuyến, nơi chia sẽ trao đổi hàng triệu tài liệu như luận văn đồ án, sách, giáo trình, đề thi.
Chúng tôi không chịu trách nhiệm liên quan đến các vấn đề bản quyền nội dung tài liệu được thành viên tự nguyện đăng tải lên, nếu phát hiện thấy tài liệu xấu hoặc tài liệu có bản quyền xin hãy email cho chúng tôi.
Đã phát hiện trình chặn quảng cáo AdBlock
Trang web này phụ thuộc vào doanh thu từ số lần hiển thị quảng cáo để tồn tại. Vui lòng tắt trình chặn quảng cáo của bạn hoặc tạm dừng tính năng chặn quảng cáo cho trang web này.