Đặt liễu xong trên một Form Data Bound Bên cạnh đó việc xử lý các vấn đề cơ bản, bạn cần phải thêm những nét hoàn thành mẫu nhập dữ liệu, chẳng hạn như cho phép / vô hiệu hóa các điều khiển dựa vào việc bạn đang ở trên một kỷ lục | Put the Finishing Touches on a Data Bound Form Besides handling the basics you need to add some finishing touches to a data entry form such as enabling disabling controls based on whether you re on a record. This How-To shows you how to use the Enabled properties on controls to give the user more direction when using a Windows form see Figure . Figure . You will create this complete form by How-To with all the bells and whistles that users expect from a good data entry form. Although the majority of the major issues are taken care of for the form you created so far in the chapter your users become confused about when to push some of the buttons. How do you get the buttons to reflect when the users can click them and what other finishing touches might help the form Technique An important part of user interfaces is letting the user know when he has access to certain features on the form. In this case you will see how to do the following Toggle the enabled property of the btnSave btnCancel btnNew and btnDelete at the appropriate moments such as when a record is highlighted in the list box. Add a command button to close the form. Add code to the Closing event of the form that tests whether you have made changes to the current record and if so whether you want to save the changes. You can see an example of particular command buttons being enabled based on the current action being performed in the form in Figure . Figure . This form allows users to access command buttons only when the functionality is available. Steps Continuing on with the form that you have been using you are going to make the changes just mentioned in the previous bulleted list. 1. Start by modifying two routines already created RefreshIndividual and ActivateEditing subroutines. Then check whether a customer has been selected in lstCustomers. If not then the two buttons btnEdit and btnDelete are disabled. If a customer hasn t been selected the two buttons are enabled and the .