TAILIEUCHUNG - Beginning Microsoft Visual Basic 2008 phần 9

thông qua các lớp . Nếu bạn muốn tìm một danh sách của tất cả các màu sắc hệ thống, hãy tìm trong tài liệu MSDN dưới lớp . Hãy thử nó ra | Chapter 20 Visual Basic 2008 and XML 3. Double-click the New button to create a Click handler. Add the highlighted line to the event handler and also add the AddNewAddress method Private Sub btnNew_Click ByVal sender As _ ByVal e As Handles AddNewAddress End Sub Public Function AddNewAddress As Address save the current address. UpdateCurrentAddress create a new address. Dim newAddress As Address update the display. CurrentAddressIndex return the new address. Return newAddress End Function 4. Run the project. Click New and a new address record is created. Enter a new address 5. Close the program and the changes will be saved. Open up and you should see the new address. How It Works This time you have a new Address object added to the XML document. It is contained within the Addresses element so you know that it is part of the same array. The implementation was very simple all you had to do was ask AddressBook to create a new address and then you updated the CurrentAddressIndex property so that it equaled the number of items in the AddressBook. This had the effect of changing the display so that it went to record 2 of 2 ready for editing. However it is important that before you actually do this you save any changes that the user might have made. With this application you are ensuring that any changes the user makes will always be persisted into the XML file. Whenever the user closes the application creates a new record or moves backward or forward in the list you want to call UpdateCurrentAddress so that any changes are saved Public Function AddNewAddress As Address save the current address. UpdateCurrentAddress After you ve saved any changes it is safe to create the new record and show the new record to the user create a new address. Dim newAddress As Address update the display. CurrentAddressIndex return the new .

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