Click here to Skip to main content
15,886,067 members
Articles / Desktop Programming / Windows Forms

Photoshop-Style Angle and Altitude Selectors

Rate me:
Please Sign up or sign in to vote.
4.97/5 (25 votes)
26 Apr 2008CPOL6 min read 58.9K   1.7K   63  
C# custom controls with the look and functionaliy of Photoshop's angle selectors.
namespace TestApp
{
    partial class RunForm
    {
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.IContainer components = null;

        /// <summary>
        /// Clean up any resources being used.
        /// </summary>
        /// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
        protected override void Dispose(bool disposing)
        {
            if (disposing && (components != null))
            {
                components.Dispose();
            }
            base.Dispose(disposing);
        }

        #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.groupBox1 = new System.Windows.Forms.GroupBox();
            this.label1 = new System.Windows.Forms.Label();
            this.txtAngle1 = new System.Windows.Forms.TextBox();
            this.angleSelector1 = new AngleAltitudeControls.AngleSelector();
            this.groupBox2 = new System.Windows.Forms.GroupBox();
            this.label3 = new System.Windows.Forms.Label();
            this.angleAltitudeSelector1 = new AngleAltitudeControls.AngleAltitudeSelector();
            this.txtAltitude = new System.Windows.Forms.TextBox();
            this.label2 = new System.Windows.Forms.Label();
            this.txtAngle2 = new System.Windows.Forms.TextBox();
            this.linkLabel1 = new System.Windows.Forms.LinkLabel();
            this.linkLabel2 = new System.Windows.Forms.LinkLabel();
            this.groupBox1.SuspendLayout();
            this.groupBox2.SuspendLayout();
            this.SuspendLayout();
            // 
            // groupBox1
            // 
            this.groupBox1.Controls.Add(this.label1);
            this.groupBox1.Controls.Add(this.txtAngle1);
            this.groupBox1.Controls.Add(this.angleSelector1);
            this.groupBox1.Location = new System.Drawing.Point(14, 10);
            this.groupBox1.Name = "groupBox1";
            this.groupBox1.Size = new System.Drawing.Size(260, 76);
            this.groupBox1.TabIndex = 0;
            this.groupBox1.TabStop = false;
            this.groupBox1.Text = "Select Angle";
            // 
            // label1
            // 
            this.label1.AutoSize = true;
            this.label1.Location = new System.Drawing.Point(65, 23);
            this.label1.Name = "label1";
            this.label1.Size = new System.Drawing.Size(37, 13);
            this.label1.TabIndex = 1;
            this.label1.Text = "Angle:";
            // 
            // txtAngle1
            // 
            this.txtAngle1.Location = new System.Drawing.Point(68, 39);
            this.txtAngle1.Name = "txtAngle1";
            this.txtAngle1.Size = new System.Drawing.Size(38, 20);
            this.txtAngle1.TabIndex = 1;
            this.txtAngle1.Text = "0";
            this.txtAngle1.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtAngle1_KeyUp);
            this.txtAngle1.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtAngle1_KeyPress);
            // 
            // angleSelector1
            // 
            this.angleSelector1.Angle = 0;
            this.angleSelector1.Location = new System.Drawing.Point(6, 21);
            this.angleSelector1.Name = "angleSelector1";
            this.angleSelector1.Size = new System.Drawing.Size(38, 38);
            this.angleSelector1.TabIndex = 1;
            this.angleSelector1.AngleChanged += new AngleAltitudeControls.AngleSelector.AngleChangedDelegate(this.angleSelector1_AngleChanged);
            // 
            // groupBox2
            // 
            this.groupBox2.Controls.Add(this.label3);
            this.groupBox2.Controls.Add(this.angleAltitudeSelector1);
            this.groupBox2.Controls.Add(this.txtAltitude);
            this.groupBox2.Controls.Add(this.label2);
            this.groupBox2.Controls.Add(this.txtAngle2);
            this.groupBox2.Location = new System.Drawing.Point(14, 92);
            this.groupBox2.Name = "groupBox2";
            this.groupBox2.Size = new System.Drawing.Size(260, 76);
            this.groupBox2.TabIndex = 1;
            this.groupBox2.TabStop = false;
            this.groupBox2.Text = "Select Angle and Altitude";
            // 
            // label3
            // 
            this.label3.AutoSize = true;
            this.label3.Location = new System.Drawing.Point(118, 23);
            this.label3.Name = "label3";
            this.label3.Size = new System.Drawing.Size(45, 13);
            this.label3.TabIndex = 3;
            this.label3.Text = "Altitude:";
            // 
            // angleAltitudeSelector1
            // 
            this.angleAltitudeSelector1.Altitude = 90;
            this.angleAltitudeSelector1.Angle = 0;
            this.angleAltitudeSelector1.Location = new System.Drawing.Point(6, 23);
            this.angleAltitudeSelector1.Name = "angleAltitudeSelector1";
            this.angleAltitudeSelector1.Size = new System.Drawing.Size(38, 38);
            this.angleAltitudeSelector1.TabIndex = 2;
            this.angleAltitudeSelector1.AngleChanged += new AngleAltitudeControls.AngleAltitudeSelector.AngleChangedDelegate(this.angleAltitudeSelector1_AngleChanged);
            this.angleAltitudeSelector1.AltitudeChanged += new AngleAltitudeControls.AngleAltitudeSelector.AltitudeChangedDelegate(this.angleAltitudeSelector1_AltitudeChanged);
            // 
            // txtAltitude
            // 
            this.txtAltitude.Location = new System.Drawing.Point(125, 39);
            this.txtAltitude.Name = "txtAltitude";
            this.txtAltitude.Size = new System.Drawing.Size(38, 20);
            this.txtAltitude.TabIndex = 2;
            this.txtAltitude.Text = "90";
            this.txtAltitude.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtAltitude_KeyUp);
            this.txtAltitude.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtAltitude_KeyPress);
            // 
            // label2
            // 
            this.label2.AutoSize = true;
            this.label2.Location = new System.Drawing.Point(65, 23);
            this.label2.Name = "label2";
            this.label2.Size = new System.Drawing.Size(37, 13);
            this.label2.TabIndex = 1;
            this.label2.Text = "Angle:";
            // 
            // txtAngle2
            // 
            this.txtAngle2.Location = new System.Drawing.Point(68, 39);
            this.txtAngle2.Name = "txtAngle2";
            this.txtAngle2.Size = new System.Drawing.Size(38, 20);
            this.txtAngle2.TabIndex = 1;
            this.txtAngle2.Text = "0";
            this.txtAngle2.KeyUp += new System.Windows.Forms.KeyEventHandler(this.txtAngle2_KeyUp);
            this.txtAngle2.KeyPress += new System.Windows.Forms.KeyPressEventHandler(this.txtAngle2_KeyPress);
            // 
            // linkLabel1
            // 
            this.linkLabel1.AutoSize = true;
            this.linkLabel1.Location = new System.Drawing.Point(11, 179);
            this.linkLabel1.Name = "linkLabel1";
            this.linkLabel1.Size = new System.Drawing.Size(90, 13);
            this.linkLabel1.TabIndex = 2;
            this.linkLabel1.TabStop = true;
            this.linkLabel1.Text = "The Code Project";
            this.linkLabel1.VisitedLinkColor = System.Drawing.Color.Blue;
            this.linkLabel1.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel1_LinkClicked);
            // 
            // linkLabel2
            // 
            this.linkLabel2.AutoSize = true;
            this.linkLabel2.Location = new System.Drawing.Point(193, 179);
            this.linkLabel2.Name = "linkLabel2";
            this.linkLabel2.Size = new System.Drawing.Size(81, 13);
            this.linkLabel2.TabIndex = 3;
            this.linkLabel2.TabStop = true;
            this.linkLabel2.Text = "Visual C# Kicks";
            this.linkLabel2.VisitedLinkColor = System.Drawing.Color.Blue;
            this.linkLabel2.LinkClicked += new System.Windows.Forms.LinkLabelLinkClickedEventHandler(this.linkLabel2_LinkClicked);
            // 
            // RunForm
            // 
            this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
            this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
            this.ClientSize = new System.Drawing.Size(284, 203);
            this.Controls.Add(this.linkLabel2);
            this.Controls.Add(this.linkLabel1);
            this.Controls.Add(this.groupBox2);
            this.Controls.Add(this.groupBox1);
            this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle;
            this.MaximizeBox = false;
            this.Name = "RunForm";
            this.StartPosition = System.Windows.Forms.FormStartPosition.CenterScreen;
            this.Text = "RunForm";
            this.groupBox1.ResumeLayout(false);
            this.groupBox1.PerformLayout();
            this.groupBox2.ResumeLayout(false);
            this.groupBox2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();

        }

        #endregion

        private System.Windows.Forms.GroupBox groupBox1;
        private System.Windows.Forms.Label label1;
        private System.Windows.Forms.TextBox txtAngle1;
        private AngleAltitudeControls.AngleSelector angleSelector1;
        private System.Windows.Forms.GroupBox groupBox2;
        private System.Windows.Forms.Label label2;
        private System.Windows.Forms.TextBox txtAngle2;
        private System.Windows.Forms.Label label3;
        private AngleAltitudeControls.AngleAltitudeSelector angleAltitudeSelector1;
        private System.Windows.Forms.TextBox txtAltitude;
        private System.Windows.Forms.LinkLabel linkLabel1;
        private System.Windows.Forms.LinkLabel linkLabel2;
    }
}

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, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United States United States
Visit Visual C# Kicks for more free C#.NET articles, resources, and downloads at
http://www.vcskicks.com

Comments and Discussions