How can I disable the right-click context menu in my textbox
You can set the ContextMenu property of the TextBox to a dummy, empty ContextMenu instance.
How do I force the focus to be on a text box in a tab page when the application gets loaded?
Listen to the Form’s Activate event and set focus on the text box (using the Focus method). The common mistake is to try to set Focus in the Form_Load event. This is not possible because no Controls are visible at this time and hence focus cannot be set at this time.
Why do the order of the tabs keep changing when opening and closing the Form?
This seems to be a known issue with the TabControl designer. The designer seems to automatically reorder the tabs while serializing changes made in the designer. To work around this issue, in your constructor, after the call to InitializeComponent, you could remove all the tab pages and add them back in the desired order.
How do I prevent the user from changing the selected tab page?
You can use the TabPage’s Validating event to prevent a new tab page selection. Here are the steps: 1) Every time the user selects a new tab, make sure that the corresponding tab page gets the focus. You can do so as follows: // In C# private void tabControl1_SelectedIndexChanged(object sender, System.EventArgs e) { tabControl1.TabPages[tabControl1.SelectedIndex].Focus(); tabControl1.TabPages[tabControl1.SelectedIndex].CausesValidation = true; } ’VB.Net Private Property sender,() As tabControl1_SelectedIndexChanged(object End Property Private Function e)() As System.EventArgs tabControl1.TabPages(tabControl1.SelectedIndex).Focus() tabControl1.TabPages(tabControl1.SelectedIndex).CausesValidation = True End Function Note that CausesValidation should be set to True since you will be listening to the Validating event in the next step. You will also have to add some code like above when the TabControl is shown the very first time (like in the Form_Load event handler). 2) Listen to the TabPage’s Validating event (which will be called when the user clicks on a different tab page) and determine whether the user should be allowed to change the selected tab page. // In C# private void tabPage1_Validating(object sender, System.ComponentModel.CancelEventArgs e) { if(!checkValidated.Checked) e.Cancel = true; } ’ In VB.Net Private Sub tabPage1_Validating(ByVal sender As Object, ByVal e As System.ComponentModel.CancelEventArgs) If Not checkValidated.Checked Then e.Cancel = True End If End Sub
How do I move a docked control around (or change the dock order) in my Form?
You cannot move it via drag-and-drop. But you change it’s position or dock order by selecting the ‘Bring To Front’ or ‘Send To Back’ verbs in it’s context menu. ‘Bring To Front’ will move it to the top of the children list and ‘Send To Back’ will move it to the last of the children list. This is possible because the docking logic will be applied on the children in the order in which they appear in the child controls list.