Professional Documents
Culture Documents
Bölüm
FORM 2
Form'un özellikleri aşağıda özetlenmektedir.
1. AcceptButton
Kontrol çalışırken ENTER tuşuna basıldığında, hangi butonun “tıklama” olayının aktifleştirileceğini;
yani hangi butona tıklanılmış gibi davranılacağını belirtir.
Ornek1
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;
namespace ornek1
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
2. AccesibleDescription
3. AccesibleName
4. AccesibleRole
5. AllowDrop
6. AutoScaleMode
6. AutoScroll
Kontrol, form üzerine sığmadığında kaydırma çubuklarının otomatik olarak eklenip eklenmeyeceğini
belirtir.
7. AutoScrollMargin
8. AutoScrollMinSize
9. AutoSize
10. AutoSizeMode
Kontrolün otomatik yeniden boyutlandırılmasını şeklini belirler ve Tablo 2’deki değerleri alabilir.
11. AutoValidate
Kontroller arasındaki aktiflik geçişlerinde doğrulama amaçlı bir değer ataması yapar ve Tablo 3’teki
değerleri alabilir.
12. BackColor
Kullanım şekilleri:
kontrol.BackColor = System.Drawing.Color.renk;
kontrol.BackColor = System.Drawing.SystemColors.renk;
kontrol.BackColor = SystemColors.renk;
Ornek2
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;
namespace ornek2
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
13. BackgroundImage
14. BackgroundImageLayout
15. CancelButton
Klavyedeki ESC tuşuyla ilgili buton kontrolünü bağlar. Yani klavyeden ESC tuşuna basıldığında, ilgili
butonda Click olayı meydana gelir.
Ornek3
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;
namespace ornek
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
16. CausesValidation
17. ContextMenuStrip
Kontrol üzerinde sağ tıklandığında açılacak olan alt menüye kısayol ayarlar.
18. ControlBox
Ornek4
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;
namespace ornek4
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
19. Cursor
20. DoubleBuffered
21. Enabled
22. Font
Ornek5
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;
namespace ornek5
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
23. ForeColor
24. FormBorderStyle
25. HelpButton
Yardım butonunun olup olmayacağını belirtir. Tam ekran (MaximizeBox) ve simge durumu
(MinimizeBox) butonlarının bulunması halinde “yardım” butonu aktifleşmemektedir.
26. Icon
27. ImeMode
Kontrolün Input Method Editor (IME) modunu belirtir. Yani farklı karakter tiplerinde girişlerin yapılıp
yapılamayacağını belirtir.
28. IsMdiContainer
Formun çoklu belge arabirimi (Multiple Document Interface – MDI) uygulamaları için bir alt form
olup olmadığını belirtir.
29. KeyPreview
Klavyedeki tuş olaylarında önceliğin formda ya da üzerindeki formda olup olmadığını ayarlar. False
ise öncelik kontrolde, True ise Form’dadır.
Ornek6
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;
namespace ornek6
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
30. Language
31. Localizable
32. Location
Ornek7
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;
namespace ornek7
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int x = 0, y = 0;
private void Form1_Click(object sender, EventArgs e)
{
x+=10; y+=10;
button1.Location = new Point(x, y);
}
}
}
33. Locked
34. MainMenuStrip
35. MaximizeBox
36. MaximumSize
37. MinimizeBox
38. MinimumSize
39. Opacity
Ornek8
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;
namespace ornek8
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
40. Padding
41. RightToLeft
42. RightToLeftLayout
43. ShowIcon
44. ShowInTaskbar
45. Size
46. SizeGripStyle
47. StartPosition
48. Tag
49. Text
50. TopMost
50. TransparencyKey
Formun saydam alanlarını temsil edecek rengi ayarlar. (Formun saydam rengini kırmızıya ayarlayıp
üzerine kırmızı buton yerleştir)
51. UseWaitCursor
52. WindowState
Uygulama penceresinin başlangıç durumu (tam ekran, simge durumuna küçültülmüş veya normal)
belirtir.
1. Activated
2. AutoSizeChanged
3. AutoValidateChanged
4. BackColorChanged
Ornek9
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;
namespace ornek9
{ public partial class Form1 : Form
{
public Form1()
{ InitializeComponent(); }
int s = 0;
private void button1_Click(object sender, EventArgs e)
{
this.BackColor = System.Drawing.Color.Blue;
}
private void Form1_BackColorChanged(object sender, EventArgs e)
{
s++;
this.Text = "Zemin rengini " + Convert.ToString(s) + "
değiştirdiniz.";
}
private void button2_Click(object sender, EventArgs e)
{
this.BackColor = System.Drawing.Color.Green;
}
}
}
5. BackgroundImageChanged
6. BackgroundImageLayoutChanged
7. BindingContextChanged
8. CausesValidationChanged
9. ChangeUICues
10. Click
Ornek10
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;
namespace ornek10
{
public partial class Form1 : Form
{
public Form1()
{ InitializeComponent(); }
{
public Form2()
{ InitializeComponent(); }
Ornek11
using System;
Form1: using System.Collections.Generic;
IsMdiContainer:True using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
namespace ornek6
{
public partial class Form1 : Form
{ public Form1()
{ InitializeComponent(); }
11. ClientSizeChanged
12. ContextMenuStripChanged
13. ControlAdded
14. ControlRemoved
15. CursorChanged
16. Deactivated
17. DockChanged
18. DoubleClick
19. DragDrop
20. DragEnter
21. DragLeave
22. DragOver
23. EnabledChanged
24. Enter
namespace ornek11
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
25. FontChanged
26. ForeColorChanged
27. FormClosed
28. FormClosing
Ornek13
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;
namespace ornek12
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
29. GiveFeedback
30. HelpButtonClicked
Ornek14
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;
namespace ornek13
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
31. HelpRequested
32. ImeModeChanged
33. InputLanguageChanged
34. InputLanguageChanging
Sistem tarafından kontrolün “InputLanguage” özelliği değişimi için istek gönderildiğinde meydana
gelir.
35. KeyDown
35. KeyPress
Klavyeden tuşa ilk basılma anından bırakılıncaya kadar ve kontrol aktif olduğu sürece meydana gelir.
36. KeyUp
Ornek15
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;
namespace ornek14
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
int s=0;
Özellik Açıklama
Alt “Alt” tuşuna basılı olup olmadığını
Control “Ctrl” tuşuna basılı olup olmadığını
Handled
KeyCode Klavye kodunu verir (Keys.karakter)
KeyData Klavye tuş verisi
KeyValue “KeyData”nın tamsayı gösterimi
Modifiers Ctrl, Shift vb. kombinasyonları
Shift “Shift” tuşuna basılı olup olmadığını
Ornek16
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;
namespace ornek15
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
Ornek17
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;
namespace ornek16
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}
}
}
}
Ornek18
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;
namespace ornek17
{
public partial class Form1 : Form
{
public Form1()
{
InitializeComponent();
}