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.

How can I Invoke a private interface implementations of an instance using reflection?

Make sure to preface the method/property name with the fully qualified interface name that it belongs to, like this: // In C# // Where someType implements ISomeInterface’s SomeMethod as a private implementation. Type someType = someInstance.GetType(); MethodInfo mi = someType.GetMethod(‘System.Windows.Forms.ISomeInterface.SomeMethod’, BindingFlags.NonPublic | BindingFlags.Instance); if(mi != null) { mi.Invoke(someInsance, new object[]{}); } ’ In VB.Net ’ Where someType implements ISomeInterface’s SomeMethod as a private implementation. Dim someType As Type = someInstance.GetType() MethodInfo mi = someType.GetMethod(‘System.Windows.Forms.ISomeInterface.SomeMethod’, BindingFlags.NonPublic | BindingFlags.Instance) If Not mi Is Nothing Then ’ Assuming no arguments for SomeMethod. mi.Invoke(someInsance, Nothing) End If

How do I implement a Folder Browser class

Below is a technique that uses FolderNameEditor and FolderBrowser classes to implement a solution. You can also use iterop to get a solution. Both the FolderNameEditor and FolderBrowser classes used in this solution are described in the Docs as ‘This type supports the .NET Framework infrastructure and is not intended to be used directly from your code.’ // add a reference to System.Design.DLL using System.Windows.Forms.Design; …………. public class DirBrowser : FolderNameEditor { FolderBrowser fb = new FolderBrowser(); public string Description { set { _description = value; } get { return _description; } } public string ReturnPath { get { return _returnPath; } } public DirBrowser() { } public DialogResult ShowDialog() { fb.Description = _description; fb.StartLocation = FolderBrowserFolder.MyComputer; DialogResult r = fb.ShowDialog(); if (r == DialogResult.OK) _returnPath = fb.DirectoryPath; else _returnPath = String.Empty; return r; } private string _description = ‘Choose Directory’; private string _returnPath = String.Empty; } (Posted by Ryan Farley on the microsoft.public.dotnet.language.csharp newsgroup)