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

Visual C# . 12. . .

.

, . , button1 (" "):

        private void button1_Click(object sender, EventArgs e)

        {

            if (form2.Visible) form2.Close(); else form2.Show();

        }

form2,

2, , *:

Visual C#  .  12.   . .

AutoSize false, Dock = Fill, TextAlign = MiddleCenter. 2, , FormClosing VisibleCanged:

using System;

using System.Collections.Generic;

using System.ComponentModel;

using System.Data;

using System.Drawing;

using System.Text;

using System.Windows.Forms;

 

namespace WindowsFormsApplication1

{

    public partial class Form2 : Form

    {

        private int count;

 

        public Form2()

        {

            InitializeComponent();

        }

 

        private void Form2_FormClosing(object sender, FormClosingEventArgs e)

        {

            if (e.CloseReason == CloseReason.UserClosing)

            {

                e.Cancel = true;

                if (MessageBox.Show(" ?", "",

                    MessageBoxButtons.YesNo, MessageBoxIcon.Question) == DialogResult.Yes)

                {

                    Hide();

                    Owner.Activate();

                }

            }

        }

 

        private void Form2_VisibleChanged(object sender, EventArgs e)

        {

            Owner.Controls["button1"].Text=Visible ? " " : " ";

            if (Visible) label1.Text = " " + (++count) + " ";

        }

    }

}

2 :

Visual C#  .  12.   . .

"", , ( " ") . , , 2:

Visual C#  .  12.   . .

:

Visual C#  .  12.   . .

Owner. 3:

Visual C#  .  12.   . .

"" "" , 3 AcceptButton "", CancelButton "". "" :

        internal void button2_Click(object sender, EventArgs e)

        {

            Owner.Text = textBox1.Text;

            Owner.OwnedForms[0].Text = textBox2.Text;

        }

, internal - , .

VisibleChange 3:

        private void Form3_VisibleChanged(object sender, EventArgs e)

        {

            if (Visible) ActiveControl = textBox1;

        }

, , , textBox1.

button2_Click :

        private void button2_Click(object sender, EventArgs e)

        {

            if (form3.ShowDialog() == DialogResult.OK)

            {

                form3.button2_Click(this, EventArgs.Empty);

            }

        }

"" "" 2, "" 3 . 3 "", 2:

Visual C#  .  12.   . .

 


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


 

 

()

 

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