Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Sức khỏe - Y tế
Văn bản luật
Nông Lâm Ngư
Kỹ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Giới thiệu
Đăng ký
Đăng nhập
Tìm
Danh mục
Kinh doanh - Marketing
Kinh tế quản lý
Biểu mẫu - Văn bản
Tài chính - Ngân hàng
Công nghệ thông tin
Tiếng anh ngoại ngữ
Kĩ thuật công nghệ
Khoa học tự nhiên
Khoa học xã hội
Văn hóa nghệ thuật
Y tế sức khỏe
Văn bản luật
Nông lâm ngư
Kĩ năng mềm
Luận văn - Báo cáo
Giải trí - Thư giãn
Tài liệu phổ thông
Văn mẫu
Thông tin
Điều khoản sử dụng
Quy định bảo mật
Quy chế hoạt động
Chính sách bản quyền
Giới thiệu
Đăng ký
Đăng nhập
0
Trang chủ
Công Nghệ Thông Tin
Kỹ thuật lập trình
The book of visual basic 2005 net insight for classic vb developers 2006 - phần 3
Đang chuẩn bị liên kết để tải về tài liệu:
The book of visual basic 2005 net insight for classic vb developers 2006 - phần 3
Nhã Sương
79
51
pdf
Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ
Tải xuống
Một khi bạn tạo ra một biến dựa trên một đại biểu, bạn có thể chỉ định một phương pháp của nó bằng cách sử dụng các nhà điều hành AddressOf. Nhà điều hành AddressOf cho phép Visual Basic 2005 biết rằng bạn đang sử dụng một tham chiếu đến một phương pháp, chứ không phải cố gắng để chạy nó trực tiếp. | Once you create a variable based on a delegate you can assign a method to it by using the AddressOf operator. The AddressOf operator lets Visual Basic 2005 know that you are using a reference to a method not trying to run it directly. Dim MyDelegate As ProcessFunction MyDelegate AddressOf CapitalizeName Once you set a delegate you can run the method later just by using the delegate Calls the CapitalizeName function and assigns its return value to UCaseName. Dim UCaseName As String UCaseName MyDelegate samantha jones This is a useful technique because it allows what programmers call an extra layer of rndim tioii. This means that the code you create is more generic and has a better chance of being reused. Here s a function that accepts a delegate as an argument and uses the function specified by the delegate to perform a task Public Sub ProcessArray MyArray As String _ FunctionToUse As ProcessFunction Dim i As Integer For i 0 to MyArray.GetUpperBound 0 MyArray i FunctionToUse MyArray i Next i End Sub You call the subroutine like this Dim CustomerNames As String bob evans chan park jill svetlova ProcessArray CustomerNames AddressOf CapitalizeName The result of this sleight of hand is that each element of CustomerNames will be modified according to the CapitalizeName method. By using a delegate you can create a single ProcessArray subroutine that can process array elements in a variety of different ways depending on the FunctionToUse reference that you supply. You only need to write the code in ProcessArray once but you still get ultimate flexibility and the envy of your colleagues . NOTE It can become a little confusing to keep all of these ingredients in mind at once. To perform this delegate test successfully you need to define the delegal.e mil a delegate variable point the delegate variable at the right method and then run the method through the delegal.e. You can see these steps in action by using the sample code available online. check out the DelegateTestl and
TÀI LIỆU LIÊN QUAN
Microsoft Visual Basic 2010
Learn Microsoft® Visual Basic® 2012
The Book of PF, 2nd Edition
The Book of Xen: A Practical Guide for the System Administrator
Art Deco stained glass pattern book
The book of visual basic 2005 net insight for classic vb developers 2006 - phần 9
The book of visual basic 2005 net insight for classic vb developers 2006 - phần 10
The book of visual basic 2005 net insight for classic vb developers 2006 - phần 1
The book of visual basic 2005 net insight for classic vb developers 2006 - phần 2
The book of visual basic 2005 net insight for classic vb developers 2006 - phần 3
crossorigin="anonymous">
Đã 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.