It is my first ever question post in any site, hope you will welcome me by helping me. I am working on a vb.net windows application where I am using treeview in my main form as software's menu. I am trying to open new forms by pressing enter or clicking on treenodes. Everything works fine when I press enter on the treenode but when I click on a treenode new form open behind the main form. Please help me how to show the new form in front of the main form (setting TopMost property or MDIParent is not appropriate for my application). Thanks in advance
Private Sub TreeView1_NodeMouseClick(ByVal sender As Object, ByVal e As System.Windows.Forms.TreeNodeMouseClickEventArgs) Handles TreeView1.NodeMouseClick
If e.Node.Text = "Purchase" Then
Dim frm As New frm_purchase
frm.Show()
End If
End Sub
Private Sub TreeView1_KeyDown(ByVal sender As Object, ByVal e As System.Windows.Forms.KeyEventArgs) Handles TreeView1.KeyDown
If e.KeyData = Keys.Enter Then
If TreeView1.SelectedNode.Text = "Purchase" Then
Dim frm As New frm_purchase
frm.Show()
End If
End If
End Sub