title: Change contextMenuStrip based on state of a different object
body: <p>I am looking for a good way to implement a TreeView in VB.net whose contextMenuStrip is variant based on the state of a different object in the form.  </p>
  
  <p>Specifically, in the 'TreeView' below, when the object state=1 display contextMenuStrip1 on items, and when state=2 display contextMenuStrip2 on items.</p>
  
  <p>So far, I've been implementing context menus like the code below, and adding the contextMenuStrip when I create the node.</p>
  
  <pre><code>Dim Context1 As ContextMenuStrip = New ContextMenuStrip
  AddHandler Context1.Items.Add("Delete Item").Click, AddressOf DeleteSub
  
  
  ------------------
  | + TreeNode1
  | + TreeNode2
  | + TreeNode3
  |   |- Item1
  |   |- Item2
  |   |- Item3
  ------------------
  </code></pre>