Manning Windows Forms Programming (phần 12)

Tham khảo tài liệu 'manning windows forms programming (phần 12)', công nghệ thông tin, kỹ thuật lập trình phục vụ nhu cầu học tập, nghiên cứu và làm việc hiệu quả | Display photograph in a PictureBox control continued Action Result 5 Update the AfterSelect event handler to use the new Displayphoto method to ensure the proper control is visible. private void treeViewMain AfterSelect . . . . if null Bad tag or top-level node. LoadAlbumData fileName DisplayPhoto null else if fileName . . . Album node selected PhotoAlbum album OpenTreeAlbum . . . LoadPhotoData album DisplayPhoto null else must be a photograph Clear the list and display the photo DisplayPhoto node 6 Add a Resize event handler for the PictureBox control to force the control to redraw the entire image when it is resized. private void pictureBoxMain_Resize object sender e Force the entire control to repaint As we mentioned at the start of this section we will not spend much time discussing these changes since they leverage concepts and features we have seen before. Let s move on to editing a tree node s label. Supporting label edits Tree nodes can be edited in a manner similar to list items. There is a BeginEdit method in the TreeNode class to initiate a label edit programmatically and BeforeLabelEdit and AfterLabelEdit events in the Treeview class that occur before and after the user edits the label. Event handlers for these events receive the NodeLabelEditEventArgs class for the event parameter. This class is summarized in .NET Table and is manipulated in much the same way as we saw for the LabelEditEventArgs class when handling label events for the Listview class. 516 chapter 15 Tree views .NET Table NodeLabelEditEventArgs class The NodeLabelEditEventArgs class represents the event data associated with the BeforeLabelEdit and AfterLabelEdit events in the Treeview class. This class is part of the namespace and inherits from the class. Public Properties CancelEdit Label Node Gets or sets whether the edit operation should .

Không thể tạo bản xem trước, hãy bấm tải xuống
TỪ KHÓA LIÊN QUAN
TÀI LIỆU MỚI ĐĂNG
Đã 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.