وبلاگ رسمی علیرضا شهامت در بلاگ اسکای

وبلاگ رسمی علیرضا شهامت در بلاگ اسکای

وبلاگ رسمی علیرضا شهامت در بلاگ اسکای - تأسیس شده در سال 1396
وبلاگ رسمی علیرضا شهامت در بلاگ اسکای

وبلاگ رسمی علیرضا شهامت در بلاگ اسکای

وبلاگ رسمی علیرضا شهامت در بلاگ اسکای - تأسیس شده در سال 1396

برنامه ی Auto-Scroll in CSharp

path01 = "G:\a\a\L\L\b\g\DS\b\e~h\b-g\Crt\mm\VS\13\C#\2t\Scroll\Auto S\001  Auto Scroll Property"


لینک دانلود سلوشن:


https://s18.picofile.com/file/8430903184/Scroll_Bi_SS_1400_01_21_a.rar.html


توضیح راجع به این برنامه:

1- هدف از این برنامه، تست کردن خاصیت یا پراپرتی AutoScroll  مربوط به فرم است.

2- در این برنامه از رنگ آمیزی برای زیبایی استفاده شده است.

3- در این برنامه ، ما آرایه ای دو بعدی از button  ها داریم که به صورت x و y  منظم چیده شده اند.

4- رنگ این باتن ها تابعی است از مختصات آنها.

5-  خاصیت اتو اسکرول (AutoScroll) خاصیتی است بولین(Boolean) که اگر ترو(true) باشد، در صورت خارج شدن کنترل های فرم از چهارچوب فرم، در اطراف فرم ، اسکرول بار برای پیمایش، اضافه می شود.

6- خاصیت اتو اسکرول (AutoScroll) برای سایر کانتینر ها ( Containers ) نیز وجود دارد(  از جمله Tab Control  ).


تصاویر محیط برنامه:


https://s18.picofile.com/file/8430902350/Screenshot_4087_.png



کدهای برنامه:










using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;


using Microsoft;

//[System.ComponentModel.TypeConverter(typeof(Microsoft.VisualStudio.Modeling.Diagrams.HslColorConverter))]
//[System.Serializable]
//public class HslColor



namespace Auto_Scroll_01
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {


            //Microsoft.CSharp.CSharpCodeProvider.

            //create_single_button();

            create_array_of_buttons();

        }

        private void create_array_of_buttons()
        {

            Button[,] my_Button_array_01;


            int count_of_columns = 6;

            int count_of_rows = 10;




            my_Button_array_01 = new Button[count_of_columns, count_of_rows];



            for (int i = 0; i < count_of_columns; i++)
            {
                for (int j = 0; j < count_of_rows; j++)
                {


                    my_Button_array_01[i, j] = new Button();

                    my_Button_array_01[i, j].Text = "  my_Button_array [" + i + ", " + j + " ] ";

                    this.Controls.Add(my_Button_array_01[i, j]);

                    my_Button_array_01[i, j].Width = 300;

                    my_Button_array_01[i, j].Height = 100;


                    //my_Button_array_01[i, j].Location.X = 200 + i * (300+20);

                    //my_Button_array_01[i, j].Location.Y = 200 + j * (100 + 20);

                    my_Button_array_01[i, j].Location = new Point(
                        120 + i * (300 + 20),
                        120 + j * (100 + 20)
                        );

                    my_Button_array_01[i, j].BackColor = Color.FromArgb(

                        (int)(255 * ((float)j / count_of_rows)),
                        ((int)(255 * ((float)j / count_of_rows)) + (int)(255 * ((float)i / count_of_columns))) / 2,
                        (int)(255 * ((float)i / count_of_columns))

                        );


                }
            }

            this.AutoScroll = true;
        }

        private void create_single_button()
        {
            Auto_Scroll_01.Form1.ActiveForm.AutoScroll = true;

            Button my_Button_01;

            my_Button_01 = new Button();

            my_Button_01.Text = "my_Button_01";

            this.Controls.Add(my_Button_01);

            my_Button_01.Width = 300;

            my_Button_01.Height = 100;

            this.AutoScroll = true;
        }
    }
}











ان شاء الله ادامه دارد...


نظرات 0 + ارسال نظر
برای نمایش آواتار خود در این وبلاگ در سایت Gravatar.com ثبت نام کنید. (راهنما)
ایمیل شما بعد از ثبت نمایش داده نخواهد شد