Visual Basic 6 Black Book phần 9

Tạo ghi Set DAO: Mở Một DAO Cơ sở dữ liệu: Thêm một kỷ lục Một Ghi Set DAO: Chỉnh sửa một bản ghi trong kỷ lục DAO: Cập nhật một bản ghi trong kỷ lục DAO: Chuyển hồ sơ đầu tiên DAO Set Ghi âm: Ghi cuối In A Ghi Set DAO: Để bản ghi tiếp theo Một Ghi Set DAO: | Visual Basic 6 Black Book Advanced Form Control And Windows Registry Handling Active Control End SSimpo PDF Merge and Split Unregistered Version - http Now we can add code to check the active control s type possible types for Visual Basic controls include CommandButton CheckBox ListBox OptionButton HScrollBar VScrollBar ComboBox Frame PictureBox Label TextBox and so on this way making sure the active control is a command button before changing its caption Private Sub Form_Click If TypeOf ActiveControl Is CommandButton Then Active Control End If End Sub Creating Loading New Controls At Runtime The Testing Department is on the phone again. Your program SuperDuperDataCrunch just doesn t have enough buttons to please some users. You ask how s that again Let s add some way to let the user create new buttons at runtime they say. To load new controls at runtime you must have a control array. This makes a lot of sense actually because you can set up event handlers for the controls in a control array and a new control just represents a new index in such an event handler. If you didn t have a control array you d need to set up an event handler for the new control that named the new control by name before it existed which the Visual Basic compiler couldn t do. When you have a control array you just use the Load statement Load object In this case object is the new control in the control array. Let s see an example. Here we ll place four buttons in a form and add a fifth when the user clicks the form. When the user does click the form we should add a new button and we start that process by calculating the index for the new control in the control array. That new control s index which we ll call intNextIndex is the index after the current end of the control array and we determine that with the Ubound property Private Sub Form_Click Dim intNextIndex As Integer intNextIndex 1 . Then we use the Load .

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
4    62    1    29-04-2024
26    679    4    29-04-2024
Đã 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.