Private Sub btnNew_Click2(ByVal sender As System.Object, ByVal e As System.EventArgs) Me.txtOrderID.ReadOnly = False End Sub4. Add the following code to your form's constructor, AFTER the call to InitializeComponent. This code registers the handler method with the New buttons' Click event:
AddHandler btnNew.Click, AddressOf btnNew_Click25. Double-click your form's Save button to create a new event handler (or to edit an existing one)...this works "as is" since there is no handler method in the form's base class. Add code to the method that sets the control's ReadOnly property to True. In the following example, the code checks the button's Result property to make sure the Save was successful (it also sets focus to the tab control's List page):
Private Sub btnSave_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnSave.Click ' Activate the List page If Me.btnSave.Result = mmSaveDataResult.RulesPassed Then Me.TabControl.SelectedTab = Me.ListPage Me.txtOrderID.ReadOnly = True End If End Sub6. Double-click your form's Cancel button to create a new event handler (or to edit an existing one). Add code to the method that sets the contorl's ReadOnly property to True (again, this code also sets focus to the tab control's List page):
Private Sub btnCancel_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCancel.Click Me.TabControl.SelectedTab = Me.ListPage Me.txtOrderID.ReadOnly = True End SubRegards,