Click here to Skip to main content
15,881,089 members
Articles / Desktop Programming / Windows Forms

Non-transparent controls on a semi-transparent window

Rate me:
Please Sign up or sign in to vote.
4.19/5 (17 votes)
6 Jul 20064 min read 86.8K   4.1K   57  
The article describes the use and the principle of operation of semi-transparent controls with non-transparent child controls.
///////////////////////////////////////////////////////////////////////////////
//
//  File:           HelpForm.cs
//
//  Facility:		The unit contains the HelpForm class.
//
//  Abstract:       The HelpForm displays the help information.
//
//  Environment:    VC 7.1
//
//  Author:         KB_Soft Group Ltd.
//
///////////////////////////////////////////////////////////////////////////////

using System;
using System.Drawing;
using System.Collections;
using System.ComponentModel;
using System.Windows.Forms;

namespace TestSkinControl
{
	/// <summary>
	/// HelpForm - is the class of the window displaying the help.
	/// </summary>
	public class HelpForm : System.Windows.Forms.Form
	{
        #region Fields

        /// <summary>
        /// The textbox containing the help information.
        /// </summary>
        private System.Windows.Forms.RichTextBox helpTextBox;
		/// <summary>
		/// Required designer variable.
		/// </summary>
		private System.ComponentModel.Container components = null;

        #endregion

        #region Constructors

        /// <summary>
        /// The constructor filling helpTextBox with the help information.
        /// </summary>
		public HelpForm()
		{
			InitializeComponent();

            helpTextBox.Text = "Press Show tooltip to display the pop-up window "+System.Environment.NewLine + System.Environment.NewLine +
                "Press HideTooltip to hide the pop-up window." + System.Environment.NewLine + System.Environment.NewLine +
                "The Alpha animation and ExpandAnimation checkboxes allow the animation type to be set." + System.Environment.NewLine + System.Environment.NewLine +
                "The Animation type combobox allows the Expand animation subtype to be set." + System.Environment.NewLine + System.Environment.NewLine +
                "The Animation time field allows the time between animation steps to be set in milliseconds." + System.Environment.NewLine + System.Environment.NewLine +
                "The Animation steps field allows the general number of animation steps to be set.";
		}

        #endregion

        #region Methods

		/// <summary>
		/// Clean up any resources being used.
		/// </summary>
		protected override void Dispose( bool disposing )
		{
			if( disposing )
			{
				if( components != null )
				{
					components.Dispose();
				}
			}
			base.Dispose( disposing );
		}

        #endregion

		#region Windows Form Designer generated code
		/// <summary>
		/// Required method for Designer support - do not modify
		/// the contents of this method with the code editor.
		/// </summary>
		private void InitializeComponent()
		{
            this.helpTextBox = new System.Windows.Forms.RichTextBox();
            this.SuspendLayout();
            // 
            // helpTextBox
            // 
            this.helpTextBox.Dock = System.Windows.Forms.DockStyle.Fill;
            this.helpTextBox.Font = new System.Drawing.Font("Times New Roman", 14.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(204)));
            this.helpTextBox.Location = new System.Drawing.Point(0, 0);
            this.helpTextBox.Name = "helpTextBox";
            this.helpTextBox.ReadOnly = true;
            this.helpTextBox.Size = new System.Drawing.Size(896, 326);
            this.helpTextBox.TabIndex = 0;
            this.helpTextBox.Text = "richTextBox1";
            // 
            // HelpForm
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(5, 13);
            this.ClientSize = new System.Drawing.Size(896, 326);
            this.Controls.Add(this.helpTextBox);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.SizableToolWindow;
            this.Name = "HelpForm";
            this.Text = "Help";
            this.ResumeLayout(false);

        }
		#endregion
	}
}

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Russian Federation Russian Federation
Alexandr Golovanov is a .NET developer at KB_Soft Group, an offshore software development company located in Russia, Novosibirsk. Here he has worked
on various .NET projects.

Comments and Discussions