Đang chuẩn bị liên kết để tải về tài liệu:
Beginning Microsoft Visual Basic 2008 phần 5

Đang chuẩn bị nút TẢI XUỐNG, xin hãy chờ

Thêm đoạn mã sau để tạo ra các phương pháp ClearEditBox: 'Xóa kiểm soát txtEdit Public Sub ClearEditBox ()' Thiết lập tài sản EditText EditText = String.Empty 'Thiết lập lại txtEdit.Foreground màu chữ = Brushes.Black' Thiết lập thanh trạng thái văn bản StatusText = "Text box xóa" End Sub | Chapter 10 Debugging and Error Handling 12. Add the following two properties to the end of the Computer class Public Readonly Property FreeMemory As String Get Using the My namespace Return Format _ My.Computer.Info.AvailablePhysicalMemory.ToString 1024 _ 0 K End Get End Property Public Readonly Property TotalMemory As String Get Using the My namespace Return Format _ My.Computer.Info.TotalPhysicalMemory.ToString 1024 _ 0 K End Get End Property 13. Switch to the code for the Debug form and add the following highlighted Imports statement Imports System.Collections.Generic Public Class Debug 14. You need to add a few private variable declarations next. Add the following code Public Class Debug Using the Generics class Private objStringValues As New Generics Of String Private objIntegerValues As New Generics Of Integer Using the List T class Private objCustomerList As New List Of Customer 15. Add the following ListCustomer procedure to add customers to the list box on your form Private Sub ListCustomer ByVal customerToList As Customer lstData.Items.Add customerToList.CustomerID _ - customerToList.CustomerName End Sub 16. Next you need to add the rest of the code to the Start button Click event handler. Select btnStart in the Class Name combo box at the top of the Code Editor and then select the Click event in the Method Name combo box. Add the following highlighted code to the Click event handler Private Sub btnStart_Click ByVal sender As Object _ ByVal e As System.EventArgs Handles btnStart.Click 335 Chapter 10 Debugging and Error Handling Declare variables Dim strData As String lstData.Items.Add String variable data If strData.Length 0 Then lstData.Items.Add strData End If Add an empty string to the ListBox lstData.Items.Add String.Empty Demonstrates the use of the List T class lstData.Items.Add Customers in the Customer Class objCustomerList.Add New Customer 1001 Henry For objCustomerList.Add New Customer 1002 Orville Wright For Each objCustomer As Customer In .

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.