If TreeView1.Nodes(1).IsSelected = True Then
this line got error
Then it's pretty obvious: for whatever reason, your Treeview does not contain at least two nodes.
Exactly why is difficult to say without the context in which that code sits, and that includes the data you are loading into your TreeView. So...the problem is going to have to be solved by you!
Put a breakpoint on the line that throws the error, and when it stops at the breakpoint, look at the Nodes collection directly in the debugger. How many nodes have you got? How many should you have? What method is the code in? When did it get called? From where?
Looking at that lot should give you an idea - if not the solution itself, it should give you better information to either work out the solution, or tell us more accurately what happens to cause the error.
Sorry, but that's pretty much the best we can do without better info!