Программирование - это просто
Advertisement
arrow C# arrow Visual C# arrow Visual C# . 15.
01.02.2023 .
1:
C#
Delphi
Web-
Excel-
.
Visual C# . 15. E-mail
megabax   
17.06.2012 .
Delphi

Visual C# . 15.

"C# ", . , . , C#.

.

. , :

isual C#  .  15.

, :

    public partial class Form1 : Form

    {

        private List<string> str = new List<string>(30);

        private List<Cursor> cur = new List<Cursor>(30);

        public Form1()

        {

            InitializeComponent();

            foreach (System.Reflection.PropertyInfo pi in typeof(Cursors).GetProperties())

            {

                str.Add(pi.Name);

                cur.Add((Cursor)pi.GetValue(null, null));

            }

            button1.Tag = str.IndexOf("Default");

        }

 

...

, C#:

  • List - . , , , foreach . , List <>, . - .

  • Cursor - . Cursor, . .

Cursor, MouseDown :

        private void button1_MouseDown(object sender, MouseEventArgs e)

        {

            int k =(int) button1.Tag;

            int c = str.Count;

            switch(e.Button)

            {

                case MouseButtons.Left:

                    k=(k+1)%c;break;

                case MouseButtons.Right:

                    k=(k-1+c)%c;break;

            }

            button1.Text=str[k];

            button1.Cursor=cur[k];

            button1.Tag=k;

        }

, , , Tag . .

, , , , ( ).


, *,   "Microsoft Visual Studio 2010 Professional", Microsoft.. 


 

 

()

 

( 15.02.2014 . )
 
. »
 
© 2023 Программирование - это просто
Joomla! - , GNU/GPL.
© 2005-2008 Joom.Ru - Joomla!
Design by Mamboteam.com | Powered by Mambobanner.de
  .