﻿<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Keep a Windows Form on Top</Title>
      <Author>Microsoft Corporation</Author>
      <Description>Shows how the TopMost property controls whether a form is a top-most form. A top-most form will float above other, non–top-most forms even when it is not active. </Description>
      <Shortcut>formTop</Shortcut>
    </Header>
    <Snippet>
      <References>
        <Reference>
          <Assembly>System.Drawing.dll</Assembly>
        </Reference>
        <Reference>
          <Assembly>System.Windows.Forms.dll</Assembly>
        </Reference>
        <Reference>
          <Assembly>System.dll</Assembly>
        </Reference>
      </References>
      <Imports>
        <Import>
          <Namespace>Microsoft.VisualBasic</Namespace>
        </Import>
        <Import>
          <Namespace>System.Drawing</Namespace>
        </Import>
        <Import>
          <Namespace>System.Windows.Forms</Namespace>
        </Import>
        <Import>
          <Namespace>System</Namespace>
        </Import>
      </Imports>
      <Declarations>
        <Object>
          <ID>formName</ID>
          <Type>Form</Type>
          <ToolTip>Replace with a reference to the form that needs to be top-most.</ToolTip>
          <Default>theTopForm</Default>
        </Object>
        <Literal>
          <ID>topBoolean</ID>
          <Type>Boolean</Type>
          <ToolTip>This value determines whether the form is top-most (true) or not (false).</ToolTip>
          <Default>True</Default>
        </Literal>
      </Declarations>
      <Code Language="VB" Kind="method body"><![CDATA[$formName$.TopMost = $topboolean$]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>