After selecting something from a Treeview, how do I shift focus to something else? Here's the code:
I thought rtbcodewindow.Focus() would automatically shift the focus to the RichTextBox called rtbcodewindow, but it doesn't.VB Code:
Private Sub TreeView1_AfterSelect(ByVal sender As System.Object, ByVal e As System.Windows.Forms.TreeViewEventArgs) Handles TreeView1.AfterSelect Try CodeDirectory = e.Node.Parent.Text code = "code\" & CodeDirectory & "\" & e.Node.Text & ".rtf" rtbcodewindow.LoadFile(code, RichTextBoxStreamType.RichText) Catch ex As Exception 'MessageBox.Show(ex.Message) End Try [b]rtbcodewindow.Focus()[/b] End Sub
Anyone any ideas?




Reply With Quote