|
-
Feb 7th, 2003, 10:50 AM
#1
Thread Starter
Hyperactive Member
Focus()
After selecting something from a Treeview, how do I shift focus to something else? Here's the code:
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
I thought rtbcodewindow.Focus() would automatically shift the focus to the RichTextBox called rtbcodewindow, but it doesn't.
Anyone any ideas?
-
Feb 7th, 2003, 11:13 AM
#2
Sleep mode
I dunno what you mean but this works for me :
-
Feb 7th, 2003, 01:52 PM
#3
Thread Starter
Hyperactive Member
You'd think so wouldn't you, nice and simple rtbcodewindow.focus(), but no. This is really for people with a mouse wheel (like myself), this is what happens:
1/. Open a parent node
2/. Select a child node
3/. Chosen text appears in Code Window.
This is what's supposed to happen
4/. Focus jumps to Code Window (Richtextbox<rtbcodewindow>)
5/. Flashing caret in Code Window
6/. User uses mouse wheel to move up and down through the code.
This is what actually happens
4/. Focus stays on Treeview
5/. No Flashing caret anywhere
6/. Moving the mouse wheel moves the Treeview left and right to show out of view text.
If I click on the Code Window, everythings ok, but otherwise I can't get the focus on the richtextbox
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|