<?xml version="1.0" encoding="utf-8"?>
<CodeSnippets xmlns="http://schemas.microsoft.com/VisualStudio/2005/CodeSnippet">
  <CodeSnippet Format="1.0.0">
    <Header>
      <Title>Fade the form into view on the load event</Title>
      <Shortcut>Fadetheformintoviewontheloadevent</Shortcut>
      <Description>Fade the form into view on the load event [C#]</Description>
      <Author>Robert Wagner</Author>
      <HelpUrl>/PreviewSnippet.aspx?SnippetID=447d4046-38b1-4877-b90e-db97b83641c0</HelpUrl>
      <SnippetTypes>
        <SnippetType>SurroundsWith</SnippetType>
      </SnippetTypes>
    </Header>
    <Snippet>
      <Code Language="csharp"><![CDATA[private void FormAlphaTransparency_Load (
	object sender,
	System.EventArgs e)
{
	// Set the form's initial opacity to 0 (100% transparent)
	// and refresh the form.
	this.Opacity = 0;
	this.Refresh();
	// We'll set the form's Opacity property. This property
	// accepts values from 0 to 1, with 0 being fully transparent
	for (double Opacity = 0; Opacity <= 1; Opacity += .05)
	{
		// Set the opacity to see the effect
		this.Opacity = Opacity;
	}
	// Force completely opaque
	this.Opacity = 1;
}
// Fade the form out of view on the Closing event
private void FormAlphaTransparency_Close (
	object sender, 
	System.ComponentModel.CancelEventArgs e)
{]]></Code>
    </Snippet>
  </CodeSnippet>
</CodeSnippets>