private void Initialize Component this button 1 new
private void Initialize. Component() { this. button 1 = new System. Windows. Forms. Button(); this. Suspend. Layout(); // // button 1 // this. button 1. Location = new System. Drawing. Point(63, 128); this. button 1. Name = "button 1"; this. button 1. Size = new System. Drawing. Size(140, 33); this. button 1. Tab. Index = 0; this. button 1. Text = "button 1"; this. button 1. Use. Visual. Style. Back. Color = true; //
// Form 1 // this. Auto. Scale. Dimensions = new System. Drawing. Size. F(8 F, 16 F); this. Auto. Scale. Mode = System. Windows. Forms. Auto. Scale. Mode. Font; this. Client. Size = new System. Drawing. Size(282, 253); this. Controls. Add(this. button 1); this. Name = "Form 1"; this. Text = "Form 1"; this. Resume. Layout(false); } // Form 1 this. Auto. Scale. Dimensions = new System. Drawing. Size. F(8 F, 16 F); this. Auto. Scale. Mode = System. Windows. Forms. Auto. Scale. Mode. Font; this. Back. Color = System. Drawing. Color. Medium. Sea. Green; this. Client. Size = new System. Drawing. Size(282, 253); this. Controls. Add(this. button 1); this. Name = "Form 1"; this. Text = "Form 1"; this. Resume. Layout(false);
Свойства Visual Studio 2005, C++ Windows Forms Application Пример описания стандартного свойства Back. Color - цвет фона элемента управления public: virtual property Color Back. Color { Color get(); void set (Color value); } Visual Studio 2012 public : override property System: : String^Text { get; set; }
private void button 1_Click(object sender, Event. Args e) { this. Back. Color = System. Drawing. Color. Green; } public override Color Back. Color { get; set; }
Вариант 1 private void button 2_Click(object sender, Event. Args e) { Form 2 form 2 = new Form 2(); form 2. Show(); } Вариант 2 private void button 3_Click(object sender, Event. Args e) { Form f = new Form(); f. Show(); }
private void Form 1_Load(object sender, Event. Args e) { //this. Text = "Load"; }
private void Form 1_Resize(object sender, Event. Args e) { this. Text = "Resize"; }
private void Form 1_Activated(object sender, Event. Args e) { this. Text = "активна Form 1"; } После запуска Приложения: private void Form 1_Load(object sender, Event. Args e) { this. Text = "Load"; } Form 1_Load Form 1_Activated private void Form 1_Deactivate(object sender, Event. Args e) { this. Text = ""; }
- Slides: 46