title: How to put if inside if (VB)?
body: <p>How can I put an <code>If</code> inside another <code>If</code>?
  Here's my code:</p>
  
  <pre><code>        If IsProcessRunning("javaw") = True Then
  
          Dim result = MessageBox.Show("message", "caption", MessageBoxButtons.OKCancel)
          If (result = DialogResult.Cancel) Then
              MessageBox.Show("Cancel pressed")
          ElseIf (result = DialogResult.OK) Then
              MessageBox.Show("Ok pressed")
  
          End If
  </code></pre>
  
  <p>This gives me error: I should put <code>End If</code> after <code>if IsProcessRunning()</code> line.
  But this will cancel the first <code>If</code> statement and will show the message box if <code>IsProcessRunning</code> is <code>True</code> or <code>False</code>.</p>
  
  <p>How can I fix this? Thanks in Advance.</p>