Đang chuẩn bị liên kết để tải về tài liệu:
Loading a Windows PictureBox with Images Stored by Access as OLE Objects

Không đóng trình duyệt đến khi xuất hiện nút TẢI XUỐNG

[ Team LiB ] Recipe 7.13 Loading a Windows PictureBox with Images Stored by Access as OLE Objects Problem You need to display images from a Microsoft Access database in a PictureBox control. Solution Strip the OLE image header that Microsoft Access adds to the image. The sample code contains six event handlers | Team LiB Recipe 7.13 Loading a Windows PictureBox with Images Stored by Access as OLE Objects Problem You need to display images from a Microsoft Access database in a PictureBox control. Solution Strip the OLE image header that Microsoft Access adds to the image. The sample code contains six event handlers Form.Load Sets up the sample by filling a DataTable within a DataSet with the Categories table from the Microsoft Access Northwind sample database. The CategorylD CategoryName and Description fields are bound to TextBox controls. The BindingManagerBase is obtained for the Categories table in the DataSet a handler is attached to manage the PositionChanged event and that handler is called to position the display on the first record. BindingManagerBase.PositionChanged Updates the PictureBox with the image for the current record. This event is raised when the Position property value changes. The CategorylD for the current record is obtained using the position information in the BindingManagerBase object. A Connection object and Command object are created and used to retrieve the Picture binary field for the category record into a Byte array. A MemoryStream object is created and the image written into it from the Byte array using an offset to strip the OLE image header. The static FromStream method of the System.Drawing.Image class is used to load the image into the PictureBox from the MemoryStream. Move First Button.Click Sets the current record of the bound controls to the first record by setting the Position property of the BindingManagerBase object to 0. Move Previous Button.Click Sets the current record of the bound controls to the previous record by decrementing the Position property of the BindingManagerBase object by 1. Move Next Button.Click Sets the current record of the bound controls to the next record by incrementing the Position property of the BindingManagerBase object by 1. Move Last Button.Click Sets the current record of the bound controls to the .

Đã 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.