Scrollable Panel : Scrollable « GUI Windows Form « C# / C Sharp

Home
C# / C Sharp
1.2D Graphics
2.Class Interface
3.Collections Data Structure
4.Components
5.Data Types
6.Database ADO.net
7.Design Patterns
8.Development Class
9.Event
10.File Stream
11.Generics
12.GUI Windows Form
13.Language Basics
14.LINQ
15.Network
16.Office
17.Reflection
18.Regular Expressions
19.Security
20.Services Event
21.Thread
22.Web Services
23.Windows
24.Windows Presentation Foundation
25.XML
26.XML LINQ
C# / C Sharp by API
C# / CSharp Tutorial
C# / CSharp Open Source
C# / C Sharp » GUI Windows Form » ScrollableScreenshots 
Scrollable Panel
Scrollable Panel

/*
User Interfaces in C#: Windows Forms and Custom Controls
by Matthew MacDonald

Publisher: Apress
ISBN: 1590590457
*/

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

namespace UnsualScrolling
{
    /// <summary>
    /// Summary description for ScrollablePanel.
    /// </summary>
    public class ScrollablePanel : System.Windows.Forms.Form
    {
        internal System.Windows.Forms.Panel Panel1;
        internal System.Windows.Forms.Button Button6;
        internal System.Windows.Forms.Button Button5;
        internal System.Windows.Forms.Button Button4;
        internal System.Windows.Forms.Button Button3;
        internal System.Windows.Forms.Button Button2;
        internal System.Windows.Forms.Button Button1;
        /// <summary>
        /// Required designer variable.
        /// </summary>
        private System.ComponentModel.Container components = null;

        public ScrollablePanel()
        {
            //
            // Required for Windows Form Designer support
            //
            InitializeComponent();

            //
            // TODO: Add any constructor code after InitializeComponent call
            //
        }

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

        #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.Panel1 = new System.Windows.Forms.Panel();
            this.Button6 = new System.Windows.Forms.Button();
            this.Button5 = new System.Windows.Forms.Button();
            this.Button4 = new System.Windows.Forms.Button();
            this.Button3 = new System.Windows.Forms.Button();
            this.Button2 = new System.Windows.Forms.Button();
            this.Button1 = new System.Windows.Forms.Button();
            this.Panel1.SuspendLayout();
            this.SuspendLayout();
            // 
            // Panel1
            // 
            this.Panel1.Anchor = (((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom
                | System.Windows.Forms.AnchorStyles.Left
                | System.Windows.Forms.AnchorStyles.Right);
            this.Panel1.AutoScroll = true;
            this.Panel1.BorderStyle = System.Windows.Forms.BorderStyle.Fixed3D;
            this.Panel1.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                                 this.Button6,
                                                                                 this.Button5,
                                                                                 this.Button4,
                                                                                 this.Button3,
                                                                                 this.Button2,
                                                                                 this.Button1});
            this.Panel1.Location = new System.Drawing.Point(48);
            this.Panel1.Name = "Panel1";
            this.Panel1.Size = new System.Drawing.Size(348172);
            this.Panel1.TabIndex = 2;
            // 
            // Button6
            // 
            this.Button6.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.Button6.Location = new System.Drawing.Point(16180);
            this.Button6.Name = "Button6";
            this.Button6.Size = new System.Drawing.Size(16824);
            this.Button6.TabIndex = 5;
            this.Button6.Text = "Button6";
            // 
            // Button5
            // 
            this.Button5.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.Button5.Location = new System.Drawing.Point(16148);
            this.Button5.Name = "Button5";
            this.Button5.Size = new System.Drawing.Size(16824);
            this.Button5.TabIndex = 4;
            this.Button5.Text = "Button5";
            // 
            // Button4
            // 
            this.Button4.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.Button4.Location = new System.Drawing.Point(16116);
            this.Button4.Name = "Button4";
            this.Button4.Size = new System.Drawing.Size(16824);
            this.Button4.TabIndex = 3;
            this.Button4.Text = "Button4";
            // 
            // Button3
            // 
            this.Button3.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.Button3.Location = new System.Drawing.Point(1684);
            this.Button3.Name = "Button3";
            this.Button3.Size = new System.Drawing.Size(16824);
            this.Button3.TabIndex = 2;
            this.Button3.Text = "Button3";
            // 
            // Button2
            // 
            this.Button2.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.Button2.Location = new System.Drawing.Point(1652);
            this.Button2.Name = "Button2";
            this.Button2.Size = new System.Drawing.Size(16824);
            this.Button2.TabIndex = 1;
            this.Button2.Text = "Button2";
            // 
            // Button1
            // 
            this.Button1.FlatStyle = System.Windows.Forms.FlatStyle.System;
            this.Button1.Location = new System.Drawing.Point(1620);
            this.Button1.Name = "Button1";
            this.Button1.Size = new System.Drawing.Size(16824);
            this.Button1.TabIndex = 0;
            this.Button1.Text = "Button1";
            // 
            // ScrollablePanel
            // 
            this.AutoScaleBaseSize = new System.Drawing.Size(514);
            this.ClientSize = new System.Drawing.Size(360194);
            this.Controls.AddRange(new System.Windows.Forms.Control[] {
                                                                          this.Panel1});
            this.Font = new System.Drawing.Font("Tahoma"8.25F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((System.Byte)(0)));
            this.Name = "ScrollablePanel";
            this.Text = "Scrollable Panel";
            this.Panel1.ResumeLayout(false);
            this.ResumeLayout(false);

        }
        #endregion

        static void Main() 
        {
            Application.Run(new ScrollablePanel());
        }
    }
}


           
       
Related examples in the same category
1.Scrollable FormScrollable Form
www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.