Node Click event occurs, all keywords matching, namely when users Click on the corresponding title, and the corresponding text will be displayed in the Rich Textbox
Attach a section of the code of others, but a small white don't understand the
Private Sub TreeView1_Click ()
If Dir (App. Path & amp; "Files \ " & amp; The Tree the View1. Selected Item & amp; ". The RTF ")="" Then
Rich Text Box1 (0). The Text=""
The Else
Rich Text Box1 (0). The File Name=App. The Path & amp; "Files \ " & amp; The Tree the View1. Selected Item & amp; ". The RTF "
End the If
End Sub
CodePudding user response:
It is best to have free who is a great god can add me WX detailed tuitionCodePudding user response:
Weixin zjx19950702CodePudding user response:
Line by line comments are as follows:
Private Sub TreeView1_Click ()
'the nodes of the tree by clicking, inciting events in the process of the
If Dir (App. Path & amp; "Files \ " & amp; The Tree the View1. Selected Item & amp; ". The RTF ")="" Then
'under the program in the path of "file" in the subdirectory, if there is no tree node display text as the file name. The RTF for extension of the file
Rich Text Box1 (0). The Text=""
'so the textbox showed empty
The Else
'(i.e., otherwise the corresponding file exists)
Rich Text Box1 (0). The File Name=App. The Path & amp; "Files \ " & amp; The Tree the View1. Selected Item & amp; ". The RTF "
'richedit open the file for display
End the If
End Sub