2 // System.Windows.Forms.Control.cs
5 // stubbed out by Jaak Simm (jaaksimm@firm.ee)
6 // Dennis Hayes (dennish@rayetk.com)
7 // WINELib implementation started by John Sohn (jsohn@columbus.rr.com)
9 // (C) Ximian, Inc., 2002
12 using System
.ComponentModel
;
14 using System
.Collections
;
16 namespace System
.Windows
.Forms
{
19 /// Defines the base class for controls, which are components with
20 /// visual representation.
23 public class Control
: Component
, ISynchronizeInvoke
, IWin32Window
{
25 // Helper NativeWindow class to dispatch messages back
26 // to the Control class
27 protected class ControlNativeWindow
: NativeWindow
{
29 private Control control
;
31 public ControlNativeWindow (Control control
) : base() {
32 this.control
= control
;
35 protected override void WndProc (ref Message m
) {
38 control
.WndProc (ref m
);
42 // FIXME: not sure if dervied classes should have access
43 protected ControlNativeWindow window
;
44 private ControlCollection childControls
;
45 private Control parent
;
48 // it seems these are stored in case the window is not created,
49 // corresponding properties (below) need to check if window
50 // is created or not and react accordingly
51 string accessibleDefaultActionDescription
;
52 string accessibleDescription
;
53 string accessibleName
;
54 AccessibleRole accessibleRole
;
58 Image backgroundImage
;
59 //BindingContext bindingContext;
61 bool causesValidation
;
62 //ContextMenu contextMenu;
69 // Point location; // using bounds to store location
72 RightToLeft rightToLeft
;
77 // --- Constructors ---
79 //Compact Framework //only Control()
82 CreateControlsInstance ();
84 accessibleDefaultActionDescription
= null;
85 accessibleDescription
= null;
86 accessibleName
= null;
87 accessibleRole
= AccessibleRole
.Default
;
89 anchor
= AnchorStyles
.Top
| AnchorStyles
.Left
;
90 //backColor = Control.DefaultBackColor;
91 backgroundImage
= null;
92 bounds
= new Rectangle();
93 // bindingContext = null;
94 causesValidation
= true;
95 // contextMenu = null;
96 dock
= DockStyle
.None
;
98 // font = Control.DefaultFont;
99 // foreColor = Control.DefaultForeColor;
100 imeMode
= ImeMode
.Inherit
;
101 isAccessible
= false;
102 // location = new Point (0,0); should be from OS
105 rightToLeft
= RightToLeft
.Inherit
;
113 // according to docs, the constructors do not create
115 public Control (string text
) : this()
118 // Win32.SetWindowTextA (Handle, text);
121 public Control (Control parent
, string text
) : this (text
)
124 // Win32.SetParent (Handle, parent.Handle);
127 public Control (string text
, int left
, int top
,
128 int width
, int height
) : this(text
)
134 //Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
135 // width, height, 0);
138 public Control (Control parent
,string text
,int left
, int top
,
139 int width
,int height
) : this (parent
, text
)
145 // Win32.SetWindowPos (Handle, (IntPtr) 0, left, top,
146 // width, height, 0);
149 // for internal use only, create a control class
150 // for an existing, created HWND
151 private Control (IntPtr existingHandle
)
153 window
= (ControlNativeWindow
) NativeWindow
.FromHandle (
157 // --- Properties ---
158 // Properties only supporting .NET framework, not stubbed out:
159 // - protected bool RenderRightToLeft {get;}
160 // - public IWindowTarget WindowTarget {get; set;}
162 //public AccessibleObject AccessibilityObject {
164 // throw new NotImplementedException ();
168 public string AccessibleDefaultActionDescription
{
170 return accessibleDefaultActionDescription
;
173 accessibleDefaultActionDescription
= value;
177 public string AccessibleDescription
{
179 return accessibleDescription
;
182 accessibleDescription
=value;
186 public string AccessibleName
{
188 return accessibleName
;
191 accessibleName
=value;
195 public AccessibleRole AccessibleRole
{
197 return accessibleRole
;
200 accessibleRole
=value;
204 public virtual bool AllowDrop
{
213 public virtual AnchorStyles Anchor
{
223 public virtual Color BackColor
{
225 if (IsHandleCreated
) {
226 IntPtr dc
= Win32
.GetDC (Handle
);
227 uint bgColor
= Win32
.GetBkColor (dc
);
228 Win32
.ReleaseDC (Handle
, dc
);
229 int r
= (int) (bgColor
& 0xFF);
230 int g
= (int) ((bgColor
>> 8) & 0xFF);
231 int b
= (int) ((bgColor
>> 16) & 0xFF);
232 return Color
.FromArgb (r
, g
, b
);
233 } else return backColor
;
237 if (IsHandleCreated
) {
238 IntPtr dc
= Win32
.GetDC (Handle
);
239 Win32
.SetBkColor (dc
, (uint) value.ToArgb());
240 Win32
.ReleaseDC (Handle
, dc
);
245 public virtual Image BackgroundImage
{
247 return backgroundImage
;
250 backgroundImage
= value;
251 // FIXME: force redraw
255 // waiting for BindingContext
256 //public virtual BindingContext BindingContext {
258 // //return bindingContext;
259 // throw new NotImplementedException ();
262 // //bindingContext=value;
263 // throw new NotImplementedException ();
275 public Rectangle Bounds
{
277 if (IsHandleCreated
) {
278 Win32
.RECT rect
= new Win32
.RECT();
279 Win32
.GetWindowRect (Handle
, ref rect
);
280 return new Rectangle ((int) rect
.left
,
284 } else return bounds
;
289 Handle
, (IntPtr
) 0, value.X
, value.Y
,
290 value.Width
, value.Height
, 0);
295 public bool CanFocus
{
297 if (IsHandleCreated
&& Visible
&& Enabled
)
304 public bool CanSelect
{
306 // if (ControlStyles.Selectable &&
307 // isContainedInAnotherControl &&
308 // parentIsVisiable && isVisialbe &&
309 // parentIsEnabled && isEnabled) {
314 throw new NotImplementedException ();
319 public bool Capture
{
321 if (IsHandleCreated
) {
322 IntPtr captured
= Win32
.GetCapture ();
323 if (Handle
== captured
)
329 if (IsHandleCreated
) {
331 Win32
.SetCapture (Handle
);
333 IntPtr captured
= Win32
.GetCapture ();
335 // if this window is in capture state
337 if (Handle
== captured
)
338 Win32
.ReleaseCapture ();
344 public bool CausesValidation
{
346 return causesValidation
;
349 causesValidation
=value;
354 public Rectangle ClientRectangle
{
356 if (IsHandleCreated
) {
357 Win32
.RECT rect
= new Win32
.RECT();
358 Win32
.GetClientRect (Handle
, ref rect
);
359 return new Rectangle ((int) rect
.left
,
365 // FIXME: is the correct return value for
366 // window who's handle is not created
367 return new Rectangle (0, 0, 0, 0);
373 public Size ClientSize
{
375 // FIXME: use GetSystemMetrics and/or
376 // GetClientRect here?
377 throw new NotImplementedException ();
380 throw new NotImplementedException ();
385 public string CompanyName
{
387 throw new NotImplementedException ();
391 public bool ContainsFocus
{
393 if (IsHandleCreated
) {
394 IntPtr focusedWindow
= Win32
.GetFocus();
395 if (focusedWindow
== Handle
)
404 //public virtual ContextMenu ContextMenu {
406 // //return contextMenu;
407 // throw new NotImplementedException ();
410 // //contextMenu=value;
411 // throw new NotImplementedException ();
415 public ControlCollection Controls
{
416 get { return childControls; }
419 public bool Created
{
421 if (Handle
!= (IntPtr
) 0)
427 protected virtual CreateParams CreateParams
{
429 CreateParams createParams
= new CreateParams ();
430 createParams
.Caption
= Text
;
431 createParams
.ClassName
= "mono_native_window";
432 createParams
.X
= Left
;
433 createParams
.Y
= Top
;
434 createParams
.Width
= Width
;
435 createParams
.Height
= Height
;
436 createParams
.ClassStyle
= 0;
437 createParams
.ExStyle
= 0;
438 createParams
.Param
= 0;
441 createParams
.Parent
= parent
.Handle
;
443 createParams
.Parent
= (IntPtr
) 0;
445 createParams
.Style
= (int) Win32
.WS_OVERLAPPEDWINDOW
;
452 public virtual Cursor Cursor
{
454 throw new NotImplementedException ();
457 throw new NotImplementedException ();
463 // waiting for BindingContext
464 //public ControlBindingsCollection DataBindings {
466 // throw new NotImplementedException ();
470 public static Color DefaultBackColor
{
472 // FIXME: use GetSystemMetrics?
473 //return SystemColors.Control;
474 throw new NotImplementedException ();
479 // FIXME: use GetSystemMetrics?
480 //public static Font DefaultFont {
481 // FIXME: get current system font from GenericSansSerif
482 // call ArgumentException not called
484 // throw new NotImplementedException ();
485 //return (FontFamily.GenericSansSerif);
489 public static Color DefaultForeColor
{
491 // FIXME: use GetSystemMetrics?
492 //return SystemColors.ControlText;
493 throw new NotImplementedException ();
497 protected virtual ImeMode DefaultImeMode
{
499 //return ImeMode.Inherit;
500 throw new NotImplementedException ();
505 protected virtual Size DefaultSize
{
507 // FIXME: use GetSystemMetrics?
508 throw new NotImplementedException ();
512 public virtual Rectangle DisplayRectangle
{
514 return ClientRectangle
;
519 public bool Disposing
{
521 throw new NotImplementedException ();
525 public virtual DockStyle Dock
{
535 public virtual bool Enabled
{
537 return Win32
.IsWindowEnabled (Handle
);
540 Win32
.EnableWindow (Handle
, value);
545 public virtual bool Focused
{
547 return ContainsFocus
;
553 //public virtual Font Font {
557 // throw new NotImplementedException ();
561 // throw new NotImplementedException ();
566 protected int FontHeight
{
568 throw new NotImplementedException ();
571 throw new NotImplementedException ();
576 public virtual Color ForeColor
{
585 public bool HasChildren
{
587 if (childControls
.Count
>0)
596 if (IsHandleCreated
) {
597 // FIXME: GetWindowPos
599 return bounds
.Height
;
602 bounds
.Height
= value;
603 if (IsHandleCreated
) {
604 // FIXME: SetWindowPos
609 public ImeMode ImeMode
{
619 public bool IsAccessible
{
623 } // default is false
629 public bool IsDisposed
{
631 if (Handle
== (IntPtr
) 0)
637 public bool IsHandleCreated
{
639 if (Handle
!= (IntPtr
) 0)
648 if (IsHandleCreated
) {
649 // FIXME: GetWindowPos
651 } else return bounds
.X
;
656 if (IsHandleCreated
) {
657 // FIXME: SetWindowPos
663 public Point Location
{
666 return new Point (Top
, Left
);
672 if (IsHandleCreated
) {
673 // FIXME: SetWindowPos
680 public static Keys ModifierKeys
{
682 throw new NotImplementedException ();
688 public static MouseButtons MouseButtons
{
690 // FIXME: use GetAsycKeyState?
691 throw new NotImplementedException ();
696 public static Point MousePosition
{
698 Win32
.POINT point
= new Win32
.POINT();
699 Win32
.GetCursorPos (ref point
);
700 return new Point ( (int) point
.x
, (int) point
.y
);
715 public Control Parent
{
718 //IntPtr parent = Win32.GetParent (Handle);
719 //return FromHandle (parent);
722 Console
.WriteLine ("setting parent");
725 Console
.WriteLine ("add ourself to the parents control");
726 // add ourself to the parents control
727 parent
.Controls
.Add (this);
729 Console
.WriteLine ("SetParent");
730 if (IsHandleCreated
) {
731 Console
.WriteLine ("Handle created");
732 Win32
.SetParent (Handle
, value.Handle
);
738 public string ProductName
{
740 throw new NotImplementedException ();
745 public string ProductVersion
{
747 throw new NotImplementedException ();
752 public bool RecreatingHandle
{
754 throw new NotImplementedException ();
758 public Region Region
{
769 protected bool ResizeRedraw
{
771 throw new NotImplementedException ();
774 throw new NotImplementedException ();
786 public virtual RightToLeft RightToLeft
{
797 protected virtual bool ShowFocusCues
{
799 throw new NotImplementedException ();
804 protected bool ShowKeyboardCues
{
806 throw new NotImplementedException ();
811 public override ISite Site
{
813 throw new NotImplementedException ();
816 throw new NotImplementedException ();
824 throw new NotImplementedException ();
827 throw new NotImplementedException ();
832 public int TabIndex
{
834 throw new NotImplementedException ();
837 throw new NotImplementedException ();
841 public bool TabStop
{
854 throw new NotImplementedException ();
857 throw new NotImplementedException ();
862 public virtual string Text
{
864 if (IsHandleCreated
) {
866 int length
= Win32
.GetWindowTextLengthA (Handle
);
867 Win32
.GetWindowTextA (Handle
, ref text
, length
);
875 Win32
.SetWindowTextA (Handle
, value);
882 if (IsHandleCreated
) {
883 // FIXME: GetWindowPos
885 } else return bounds
.Top
;
890 if (IsHandleCreated
) {
891 // FIXME: SetWindowPos
897 public Control TopLevelControl
{
899 throw new NotImplementedException ();
904 public bool Visible
{
906 throw new NotImplementedException ();
911 Handle
, Win32
.SW_SHOW
);
914 Handle
, Win32
.SW_HIDE
);
921 if (IsHandleCreated
) {
922 // FIXME: GetWindowPos
927 bounds
.Width
= value;
928 if (IsHandleCreated
) {
929 // FIXME: SetWindowPos
935 /// internal .NET framework supporting methods, not stubbed out:
936 /// - protected virtual void NotifyInvalidate(Rectangle invalidatedArea)
937 /// - protected void RaiseDragEvent(object key,DragEventArgs e);
938 /// - protected void RaiseKeyEvent(object key,KeyEventArgs e);
939 /// - protected void RaiseMouseEvent(object key,MouseEventArgs e);
940 /// - protected void RaisePaintEvent(object key,PaintEventArgs e);
941 /// - protected void ResetMouseEventArgs();
944 protected void AccessibilityNotifyClients (
945 AccessibleEvents accEvent
,int childID
)
947 throw new NotImplementedException ();
952 public void BringToFront ()
954 throw new NotImplementedException ();
957 public bool Contains (Control ctl
)
959 return childControls
.Contains (ctl
);
962 public void CreateControl ()
968 //AccessibleObject not ready
969 //protected virtual AccessibleObject CreateAccessibilityInstance() {
970 // throw new NotImplementedException ();
973 protected virtual ControlCollection
CreateControlsInstance ()
975 childControls
= new ControlCollection (this);
976 return childControls
;
981 public Graphics
CreateGraphics ()
983 throw new NotImplementedException ();
986 protected virtual void CreateHandle ()
988 window
= new ControlNativeWindow (this);
990 window
.CreateHandle (CreateParams
);
993 protected virtual void DefWndProc (ref Message m
)
995 window
.DefWndProc(ref m
);
998 protected virtual void DestroyHandle ()
1000 window
.DestroyHandle ();
1004 protected override void Dispose (bool disposing
)
1006 throw new NotImplementedException ();
1010 public DragDropEffects
DoDragDrop (
1011 object data
, DragDropEffects allowedEffects
)
1013 throw new NotImplementedException ();
1016 //public object EndInvoke(IAsyncResult asyncResult):
1017 //look under ISynchronizeInvoke methods
1020 public Form
FindForm ()
1022 throw new NotImplementedException ();
1026 public bool Focus ()
1028 if (Win32
.SetFocus (Handle
) != (IntPtr
) 0)
1034 public static Control
FromChildHandle (IntPtr handle
)
1036 throw new NotImplementedException ();
1039 public static Control
FromHandle (IntPtr handle
)
1041 Control control
= new Control (handle
);
1046 public Control
GetChildAtPoint (Point pt
)
1048 throw new NotImplementedException ();
1052 //public IContainerControl GetContainerControl ()
1054 // throw new NotImplementedException ();
1058 public Control
GetNextControl (Control ctl
, bool forward
)
1060 throw new NotImplementedException ();
1064 protected bool GetStyle (ControlStyles flag
)
1066 throw new NotImplementedException ();
1070 protected bool GetTopLevel ()
1072 throw new NotImplementedException ();
1078 if (IsHandleCreated
)
1079 Win32
.ShowWindow (Handle
, Win32
.SW_HIDE
);
1083 protected virtual void InitLayout ()
1085 throw new NotImplementedException ();
1089 public void Invalidate ()
1091 if (IsHandleCreated
) {
1092 Win32
.RECT rect
= (Win32
.RECT
) null;
1093 Win32
.InvalidateRect (Handle
, ref rect
, true);
1098 public void Invalidate (bool invalidateChildren
)
1100 throw new NotImplementedException ();
1104 public void Invalidate (Rectangle rc
)
1106 if (IsHandleCreated
) {
1107 Win32
.RECT rect
= new Win32
.RECT();
1108 rect
.left
= rc
.Left
;
1110 rect
.right
= rc
.Right
;
1111 rect
.bottom
= rc
.Bottom
;
1112 Win32
.InvalidateRect (Handle
, ref rect
, true);
1117 public void Invalidate(Region region
)
1119 throw new NotImplementedException ();
1123 public void Invalidate (Rectangle rc
, bool invalidateChildren
)
1125 throw new NotImplementedException ();
1129 public void Invalidate(Region region
,bool invalidateChildren
)
1131 throw new NotImplementedException ();
1135 protected void InvokeGotFocus (Control toInvoke
, EventArgs e
)
1137 throw new NotImplementedException ();
1141 protected void InvokeLostFocus (Control toInvoke
, EventArgs e
)
1143 throw new NotImplementedException ();
1147 protected void InvokeOnClick (Control toInvoke
, EventArgs e
)
1149 throw new NotImplementedException ();
1153 protected void InvokePaint (Control c
, PaintEventArgs e
)
1155 throw new NotImplementedException ();
1159 protected void InvokePaintBackground (
1160 Control c
,PaintEventArgs e
)
1162 throw new NotImplementedException ();
1166 protected virtual bool IsInputChar (char charCode
)
1168 throw new NotImplementedException ();
1172 protected virtual bool IsInputKey (Keys keyData
)
1174 throw new NotImplementedException ();
1178 public static bool IsMnemonic (char charCode
,string text
)
1180 throw new NotImplementedException ();
1183 // methods used with events:
1184 protected virtual void OnBackColorChanged (EventArgs e
)
1186 if (BackColorChanged
!= null)
1187 BackColorChanged (this, e
);
1190 protected virtual void OnBackgroundImageChanged (EventArgs e
)
1192 if (BackgroundImageChanged
!= null)
1193 BackgroundImageChanged (this, e
);
1196 protected virtual void OnBindingContextChanged (EventArgs e
)
1198 if (BindingContextChanged
!= null)
1199 BindingContextChanged (this, e
);
1202 protected virtual void OnCausesValidationChanged (EventArgs e
)
1204 if (CausesValidationChanged
!= null)
1205 CausesValidationChanged (this, e
);
1208 protected virtual void OnChangeUICues(UICuesEventArgs e
)
1210 if (ChangeUICues
!= null)
1211 ChangeUICues (this, e
);
1215 protected virtual void OnClick (EventArgs e
)
1222 protected virtual void OnContextMenuChanged (EventArgs e
)
1224 if (ContextMenuChanged
!= null)
1225 ContextMenuChanged (this, e
);
1228 protected virtual void OnControlAdded (ControlEventArgs e
)
1230 if (ControlAdded
!= null)
1231 ControlAdded (this, e
);
1234 protected virtual void OnControlRemoved (ControlEventArgs e
)
1236 if (ControlRemoved
!= null)
1237 ControlRemoved (this, e
);
1240 protected virtual void OnCreateControl ()
1245 protected virtual void OnCursorChanged (EventArgs e
)
1247 if (CursorChanged
!= null)
1248 CursorChanged (this, e
);
1251 protected virtual void OnDockChanged (EventArgs e
)
1253 if (DockChanged
!= null)
1254 DockChanged (this, e
);
1257 protected virtual void OnDoubleClick (EventArgs e
)
1259 if (DoubleClick
!= null)
1260 DoubleClick (this, e
);
1263 protected virtual void OnDragDrop (DragEventArgs e
)
1265 if (DragDrop
!= null)
1269 protected virtual void OnDragEnter (DragEventArgs e
)
1271 if (DragEnter
!= null)
1272 DragEnter (this, e
);
1275 protected virtual void OnDragLeave (EventArgs e
)
1277 if (DragLeave
!= null)
1278 DragLeave (this, e
);
1281 protected virtual void OnDragOver (DragEventArgs e
)
1283 if (DragOver
!= null)
1288 protected virtual void OnEnabledChanged (EventArgs e
)
1290 if (EnabledChanged
!= null)
1291 EnabledChanged (this, e
);
1294 protected virtual void OnEnter (EventArgs e
)
1300 protected virtual void OnFontChanged (EventArgs e
)
1302 if (FontChanged
!= null)
1303 FontChanged (this, e
);
1306 protected virtual void OnForeColorChanged (EventArgs e
)
1308 if (ForeColorChanged
!= null)
1309 ForeColorChanged (this, e
);
1312 protected virtual void OnGiveFeedback (GiveFeedbackEventArgs e
)
1314 if (GiveFeedback
!= null)
1315 GiveFeedback (this, e
);
1319 protected virtual void OnGotFocus (EventArgs e
)
1321 if (GotFocus
!= null)
1325 protected virtual void OnHandleCreated (EventArgs e
)
1327 Console
.WriteLine ("OnHandleCreated");
1329 if (HandleCreated
!= null)
1330 HandleCreated (this, e
);
1332 // create all child windows
1333 IEnumerator cw
= childControls
.GetEnumerator();
1335 while (cw
.MoveNext()) {
1336 Console
.WriteLine ("Adding Control");
1337 Control control
= (Control
) cw
.Current
;
1338 control
.CreateControl ();
1343 protected virtual void OnHandleDestroyed (EventArgs e
)
1345 if (HandleDestroyed
!= null)
1346 HandleDestroyed (this, e
);
1349 protected virtual void OnHelpRequested (HelpEventArgs e
)
1351 if (HelpRequested
!= null)
1352 HelpRequested (this, e
);
1355 protected virtual void OnImeModeChanged (EventArgs e
)
1357 if (ImeModeChanged
!= null)
1358 ImeModeChanged (this, e
);
1361 protected virtual void OnInvalidated (InvalidateEventArgs e
)
1363 if (Invalidated
!= null)
1364 Invalidated (this, e
);
1368 protected virtual void OnKeyDown (KeyEventArgs e
)
1370 if (KeyDown
!= null)
1375 protected virtual void OnKeyPress (KeyPressEventArgs e
)
1377 if (KeyPress
!= null)
1382 protected virtual void OnKeyUp (KeyEventArgs e
)
1389 protected virtual void OnLayout (LayoutEventArgs e
)
1395 protected virtual void OnLeave (EventArgs e
)
1401 protected virtual void OnLocationChanged (EventArgs e
)
1403 if (LocationChanged
!= null)
1404 LocationChanged (this, e
);
1408 protected virtual void OnLostFocus (EventArgs e
)
1410 if (LostFocus
!= null)
1411 LostFocus (this, e
);
1415 protected virtual void OnMouseDown (MouseEventArgs e
)
1417 if (MouseDown
!= null)
1418 MouseDown (this, e
);
1421 protected virtual void OnMouseEnter (EventArgs e
)
1423 if (MouseEnter
!= null)
1424 MouseEnter (this, e
);
1427 protected virtual void OnMouseHover (EventArgs e
)
1429 if (MouseHover
!= null)
1430 MouseHover (this, e
);
1433 protected virtual void OnMouseLeave (EventArgs e
)
1435 if (MouseLeave
!= null)
1436 MouseLeave (this, e
);
1440 protected virtual void OnMouseMove (MouseEventArgs e
)
1442 if (MouseMove
!= null)
1443 MouseMove (this, e
);
1447 protected virtual void OnMouseUp (MouseEventArgs e
)
1449 if (MouseUp
!= null)
1453 protected virtual void OnMouseWheel (MouseEventArgs e
)
1455 if (MouseWheel
!= null)
1456 MouseWheel (this, e
);
1459 protected virtual void OnMove (EventArgs e
)
1465 protected virtual void OnNotifyMessage (Message m
)
1471 protected virtual void OnPaint (PaintEventArgs e
)
1478 protected virtual void OnPaintBackground (PaintEventArgs e
)
1483 protected virtual void OnParentBackColorChanged (EventArgs e
)
1485 if (BackColorChanged
!= null)
1486 BackColorChanged (this, e
);
1489 protected virtual void OnParentBackgroundImageChanged (
1492 if (BackgroundImageChanged
!= null)
1493 BackgroundImageChanged (this, e
);
1496 protected virtual void OnParentBindingContextChanged (
1499 if (BindingContextChanged
!= null)
1500 BindingContextChanged (this, e
);
1504 protected virtual void OnParentChanged (EventArgs e
)
1506 if (ParentChanged
!= null)
1507 ParentChanged (this, e
);
1510 protected virtual void OnParentEnabledChanged (EventArgs e
)
1512 if (EnabledChanged
!= null)
1513 EnabledChanged (this, e
);
1516 protected virtual void OnParentFontChanged (EventArgs e
)
1518 if (FontChanged
!= null)
1519 FontChanged (this, e
);
1522 protected virtual void OnParentForeColorChanged (EventArgs e
)
1524 if (ForeColorChanged
!= null)
1525 ForeColorChanged (this, e
);
1528 protected virtual void OnParentRightToLeftChanged (
1531 if (RightToLeftChanged
!= null)
1532 RightToLeftChanged (this, e
);
1535 protected virtual void OnParentVisibleChanged (EventArgs e
)
1537 if (VisibleChanged
!= null)
1538 VisibleChanged (this, e
);
1541 protected virtual void OnQueryContinueDrag (
1542 QueryContinueDragEventArgs e
)
1544 if (QueryContinueDrag
!= null)
1545 QueryContinueDrag (this, e
);
1549 protected virtual void OnResize (EventArgs e
)
1555 protected virtual void OnRightToLeftChanged (EventArgs e
)
1557 if (RightToLeftChanged
!= null)
1558 RightToLeftChanged (this, e
);
1561 protected virtual void OnSizeChanged (EventArgs e
)
1563 if (SizeChanged
!= null)
1564 SizeChanged (this, e
);
1567 protected virtual void OnStyleChanged (EventArgs e
)
1569 if (StyleChanged
!= null)
1570 StyleChanged (this, e
);
1573 protected virtual void OnSystemColorsChanged (EventArgs e
)
1575 if (SystemColorsChanged
!= null)
1576 SystemColorsChanged (this, e
);
1579 protected virtual void OnTabIndexChanged (EventArgs e
)
1581 if (TabIndexChanged
!= null)
1582 TabIndexChanged (this, e
);
1585 protected virtual void OnTabStopChanged (EventArgs e
)
1587 if (TabStopChanged
!= null)
1588 TabStopChanged (this, e
);
1592 protected virtual void OnTextChanged (EventArgs e
)
1594 if (TextChanged
!= null)
1595 TextChanged (this, e
);
1598 [MonoTODO
] // this doesn't seem to be documented
1599 // protected virtual void OnTextAlignChanged (EventArgs e) {
1600 // TextAlignChanged (this, e);
1603 protected virtual void OnValidated (EventArgs e
)
1605 if (Validated
!= null)
1606 Validated (this, e
);
1610 // CancelEventArgs not ready
1611 //protected virtual void OnValidating(CancelEventArgs e)
1613 // throw new NotImplementedException ();
1617 protected virtual void OnVisibleChanged (EventArgs e
)
1619 if (VisibleChanged
!= null)
1620 VisibleChanged (this, e
);
1622 // --- end of methods for events ---
1626 public void PerformLayout ()
1628 throw new NotImplementedException ();
1632 public void PerformLayout (Control affectedControl
,
1633 string affectedProperty
)
1635 throw new NotImplementedException ();
1640 public Point
PointToClient (Point p
)
1642 throw new NotImplementedException ();
1647 public Point
PointToScreen (Point p
)
1649 throw new NotImplementedException ();
1653 public virtual bool PreProcessMessage (ref Message msg
)
1655 throw new NotImplementedException ();
1659 protected virtual bool ProcessCmdKey (ref Message msg
,
1662 throw new NotImplementedException ();
1666 protected virtual bool ProcessDialogChar (char charCode
)
1668 throw new NotImplementedException ();
1672 protected virtual bool ProcessDialogKey (Keys keyData
)
1674 throw new NotImplementedException ();
1678 protected virtual bool ProcessKeyEventArgs (ref Message m
)
1680 throw new NotImplementedException ();
1684 protected internal virtual bool ProcessKeyMessage (
1687 throw new NotImplementedException ();
1691 protected virtual bool ProcessKeyPreview (ref Message m
)
1693 throw new NotImplementedException ();
1697 protected virtual bool ProcessMnemonic (char charCode
)
1699 throw new NotImplementedException ();
1702 // used when properties/values of Control
1703 // are big enough to warrant recreating the HWND
1704 protected void RecreateHandle()
1712 public Rectangle
RectangleToClient (Rectangle r
)
1714 throw new NotImplementedException ();
1719 public Rectangle
RectangleToScreen (Rectangle r
)
1721 throw new NotImplementedException ();
1725 protected static bool ReflectMessage (IntPtr hWnd
,
1728 throw new NotImplementedException ();
1732 public virtual void Refresh ()
1734 Win32
.RECT rect
= (Win32
.RECT
) null;
1735 Win32
.InvalidateRect (Handle
, ref rect
, true);
1736 Win32
.UpdateWindow (Handle
);
1740 public virtual void ResetBackColor ()
1742 throw new NotImplementedException ();
1746 public void ResetBindings ()
1748 throw new NotImplementedException ();
1752 public virtual void ResetFont ()
1754 throw new NotImplementedException ();
1758 public virtual void ResetForeColor ()
1760 throw new NotImplementedException ();
1764 public void ResetImeMode ()
1766 throw new NotImplementedException ();
1770 public virtual void ResetRightToLeft ()
1772 throw new NotImplementedException ();
1776 public virtual void ResetText ()
1778 throw new NotImplementedException ();
1782 public void ResumeLayout ()
1784 throw new NotImplementedException ();
1788 public void ResumeLayout (bool performLayout
)
1790 throw new NotImplementedException ();
1794 protected ContentAlignment
RtlTranslateAlignment (
1795 ContentAlignment align
)
1797 throw new NotImplementedException ();
1801 protected HorizontalAlignment
RtlTranslateAlignment (
1802 HorizontalAlignment align
)
1804 throw new NotImplementedException ();
1808 protected LeftRightAlignment
RtlTranslateAlignment (
1809 LeftRightAlignment align
)
1811 throw new NotImplementedException ();
1815 protected ContentAlignment
RtlTranslateContent (
1816 ContentAlignment align
)
1818 throw new NotImplementedException ();
1822 protected HorizontalAlignment
RtlTranslateHorizontal (
1823 HorizontalAlignment align
)
1825 throw new NotImplementedException ();
1829 protected LeftRightAlignment
RtlTranslateLeftRight (
1830 LeftRightAlignment align
)
1832 throw new NotImplementedException ();
1836 public void Scale (float ratio
)
1838 throw new NotImplementedException ();
1842 public void Scale (float dx
,float dy
)
1844 throw new NotImplementedException ();
1848 protected virtual void ScaleCore (float dx
, float dy
)
1850 throw new NotImplementedException ();
1854 public void Select ()
1856 throw new NotImplementedException ();
1860 protected virtual void Select (bool directed
,bool forward
)
1862 throw new NotImplementedException ();
1866 public bool SelectNextControl (Control ctl
, bool forward
,
1868 bool nested
, bool wrap
)
1870 throw new NotImplementedException ();
1875 public void SendToBack ()
1877 throw new NotImplementedException ();
1881 public void SetBounds (int x
, int y
, int width
, int height
)
1883 throw new NotImplementedException ();
1887 public void SetBounds (int x
, int y
, int width
, int height
,
1888 BoundsSpecified specified
)
1890 throw new NotImplementedException ();
1894 protected virtual void SetBoundsCore (
1895 int x
, int y
, int width
, int height
,
1896 BoundsSpecified specified
)
1898 throw new NotImplementedException ();
1902 protected virtual void SetClientSizeCore (int x
, int y
)
1904 throw new NotImplementedException ();
1908 protected void SetStyle (ControlStyles flag
, bool value)
1910 throw new NotImplementedException ();
1913 protected void SetTopLevel (bool value)
1916 // FIXME: verify on whether this is supposed
1917 // to activate/deactive the window
1918 Win32
.SetWindowPos (Handle
,
1919 (IntPtr
) Win32
.HWND_NOTOPMOST
,
1922 // FIXME: this does not make sense but
1923 // the docs say the window is hidden
1924 Win32
.ShowWindow (Handle
, Win32
.SW_HIDE
);
1928 protected virtual void SetVisibleCore (bool value)
1930 throw new NotImplementedException ();
1936 Win32
.ShowWindow (Handle
, Win32
.SW_SHOW
);
1940 public void SuspendLayout ()
1942 throw new NotImplementedException ();
1946 public void Update ()
1948 Win32
.UpdateWindow (Handle
);
1952 protected void UpdateBounds ()
1954 throw new NotImplementedException ();
1958 protected void UpdateBounds (int x
, int y
, int width
, int height
)
1960 throw new NotImplementedException ();
1964 protected void UpdateBounds (
1965 int x
, int y
, int width
, int height
, int clientWidth
,
1968 throw new NotImplementedException ();
1972 protected void UpdateStyles ()
1974 throw new NotImplementedException ();
1978 protected void UpdateZOrder ()
1980 throw new NotImplementedException ();
1983 // WndProc - calls appriate On... function for the give
1986 // These On... functions do not appear to be called by
1989 // background color/image handled by WinForms
1990 // OnBackColorChanged
1991 // OnBackgroundImageChanged
1992 // OnForeColorChanged
1993 // OnPaintBackground
1995 // controls are added/removed by WinForms
2000 // OnBindingContextChanged
2001 // OnCausesValidationChanged
2003 // OnContextMenuChanged
2004 // OnRightToLeftChanged
2009 // OnTextAlignChanged
2012 // OnTabIndexChanged
2014 // OnLocationChanged
2016 // FIXME: may be one of the WM_IME_ messages
2019 // InvalidateRect is called by no Invalidate message exists
2022 // these messages ARE not called by WNDPROC according to docs
2023 // OnParentBackColorChanged
2024 // OnParentBackgroundImageChanged
2025 // OnParentBindingContextChanged
2027 // OnParentEnabledChanged
2028 // OnParentFontChanged
2029 // OnParentForeColorChanged
2030 // OnParentRightToLeftChanged
2031 // OnParentVisibleChanged
2033 protected virtual void WndProc(ref Message m
)
2035 EventArgs eventArgs
= new EventArgs ();
2036 // FIXME: paintEventArgs is not being created properly
2037 PaintEventArgs paintEventArgs
= new PaintEventArgs (
2038 new Graphics(), new Rectangle());
2042 case Win32
.WM_CREATE
:
2043 Console
.WriteLine ("WM_CREATE");
2044 OnHandleCreated (eventArgs
);
2046 case Win32
.WM_LBUTTONDBLCLK
:
2047 OnDoubleClick (eventArgs
);
2053 // OnQueryContinueDrag
2054 case Win32
.WM_ENABLE
:
2055 OnEnabledChanged (eventArgs
);
2057 case Win32
.WM_SETFOCUS
:
2058 OnEnter (eventArgs
);
2059 OnGotFocus (eventArgs
);
2061 case Win32
.WM_FONTCHANGE
:
2062 OnFontChanged (eventArgs
);
2064 case Win32
.WM_DESTROY
:
2065 OnHandleDestroyed (eventArgs
);
2069 //OnHelpRequested (eventArgs);
2071 case Win32
.WM_KEYDOWN
:
2073 // OnKeyDown (eventArgs);
2077 // OnKeyPress (eventArgs);
2079 case Win32
.WM_KEYUP
:
2081 // OnKeyUp (eventArgs);
2083 case Win32
.WM_KILLFOCUS
:
2084 OnLeave (eventArgs
);
2085 OnLostFocus (eventArgs
);
2087 case Win32
.WM_LBUTTONDOWN
:
2089 // OnMouseDown (eventArgs);
2091 case Win32
.WM_MOUSEACTIVATE
:
2092 OnMouseEnter (eventArgs
);
2094 case Win32
.WM_MOUSEHOVER
: // called by TrackMouseEvent
2095 OnMouseHover (eventArgs
);
2097 case Win32
.WM_MOUSELEAVE
: // called by TrackMouseEvent
2098 OnMouseLeave (eventArgs
);
2100 case Win32
.WM_MOUSEMOVE
:
2102 // OnMouseMove (eventArgs);
2104 case Win32
.WM_LBUTTONUP
:
2106 // OnMouseUp (eventArgs);
2108 case Win32
.WM_MOUSEWHEEL
:
2110 // OnMouseWheel (eventArgs);
2115 case Win32
.WM_NOTIFY
:
2116 // FIXME: get NM_CLICKED msg from pnmh
2117 // OnClick (eventArgs);
2118 // OnNotifyMessage (eventArgs);
2119 case Win32
.WM_PAINT
:
2120 OnPaint (paintEventArgs
);
2123 OnResize (eventArgs
);
2124 OnSizeChanged (eventArgs
);
2126 case Win32
.WM_STYLECHANGED
:
2127 OnStyleChanged (eventArgs
);
2129 case Win32
.WM_SYSCOLORCHANGE
:
2130 OnSystemColorsChanged (eventArgs
);
2132 case Win32
.WM_SETTEXT
:
2133 OnTextChanged (eventArgs
);
2135 case Win32
.WM_SHOWWINDOW
:
2136 OnVisibleChanged (eventArgs
);
2139 // DefWndProc (ref m);
2144 /// --- Control: events ---
2145 public event EventHandler BackColorChanged
;// {
2147 // throw new NotImplementedException ();
2150 // throw new NotImplementedException ();
2154 public event EventHandler BackgroundImageChanged
; //{
2156 // throw new NotImplementedException ();
2159 // throw new NotImplementedException ();
2163 public event EventHandler BindingContextChanged
; // {
2165 // throw new NotImplementedException ();
2168 // throw new NotImplementedException ();
2172 public event EventHandler CausesValidationChanged
; // {
2174 // throw new NotImplementedException ();
2177 // throw new NotImplementedException ();
2181 public event UICuesEventHandler ChangeUICues
; // {
2183 // throw new NotImplementedException ();
2186 // throw new NotImplementedException ();
2191 public event EventHandler Click
; // {
2193 // throw new NotImplementedException ();
2196 // throw new NotImplementedException ();
2200 public event EventHandler ContextMenuChanged
;
2202 public event ControlEventHandler ControlAdded
; // {
2204 // throw new NotImplementedException ();
2207 // throw new NotImplementedException ();
2211 public event ControlEventHandler ControlRemoved
; // {
2213 // throw new NotImplementedException ();
2216 // throw new NotImplementedException ();
2220 public event EventHandler CursorChanged
; // {
2222 // throw new NotImplementedException ();
2225 // throw new NotImplementedException ();
2229 public event EventHandler DockChanged
; // {
2231 // throw new NotImplementedException ();
2234 // throw new NotImplementedException ();
2238 public event EventHandler DoubleClick
; // {
2240 // throw new NotImplementedException ();
2243 // throw new NotImplementedException ();
2247 public event DragEventHandler DragDrop
; // {
2249 // throw new NotImplementedException ();
2252 // throw new NotImplementedException ();
2256 public event DragEventHandler DragEnter
; // {
2258 // throw new NotImplementedException ();
2261 // throw new NotImplementedException ();
2265 public event EventHandler DragLeave
; // {
2267 // throw new NotImplementedException ();
2270 // throw new NotImplementedException ();
2274 public event DragEventHandler DragOver
; // {
2276 // throw new NotImplementedException ();
2279 // throw new NotImplementedException ();
2284 public event EventHandler EnabledChanged
; // {
2286 // throw new NotImplementedException ();
2289 // throw new NotImplementedException ();
2293 public event EventHandler Enter
; // {
2295 // throw new NotImplementedException ();
2298 // throw new NotImplementedException ();
2302 public event EventHandler FontChanged
; // {
2304 // throw new NotImplementedException ();
2307 // throw new NotImplementedException ();
2311 public event EventHandler ForeColorChanged
; // {
2313 // throw new NotImplementedException ();
2316 // throw new NotImplementedException ();
2320 public event GiveFeedbackEventHandler GiveFeedback
; // {
2322 // throw new NotImplementedException ();
2325 // throw new NotImplementedException ();
2330 public event EventHandler GotFocus
; // {
2332 // throw new NotImplementedException ();
2335 // throw new NotImplementedException ();
2339 public event EventHandler HandleCreated
; // {
2341 // throw new NotImplementedException ();
2344 // throw new NotImplementedException ();
2348 public event EventHandler HandleDestroyed
; // {
2350 // throw new NotImplementedException ();
2353 // throw new NotImplementedException ();
2357 public event HelpEventHandler HelpRequested
; // {
2359 // throw new NotImplementedException ();
2362 // throw new NotImplementedException ();
2366 public event EventHandler ImeModeChanged
; // {
2368 // throw new NotImplementedException ();
2371 // throw new NotImplementedException ();
2375 public event InvalidateEventHandler Invalidated
; // {
2377 // throw new NotImplementedException ();
2380 // throw new NotImplementedException ();
2385 public event KeyEventHandler KeyDown
; // {
2387 // throw new NotImplementedException ();
2390 // throw new NotImplementedException ();
2395 public event KeyPressEventHandler KeyPress
; // {
2397 // throw new NotImplementedException ();
2400 // throw new NotImplementedException ();
2405 public event KeyEventHandler KeyUp
; // {
2407 // throw new NotImplementedException ();
2410 // throw new NotImplementedException ();
2414 public event LayoutEventHandler Layout
; // {
2416 // throw new NotImplementedException ();
2419 // throw new NotImplementedException ();
2423 public event EventHandler Leave
; // {
2425 // throw new NotImplementedException ();
2428 // throw new NotImplementedException ();
2432 public event EventHandler LocationChanged
; // {
2434 // throw new NotImplementedException ();
2437 // throw new NotImplementedException ();
2442 public event EventHandler LostFocus
; // {
2444 // throw new NotImplementedException ();
2447 // throw new NotImplementedException ();
2452 public event MouseEventHandler MouseDown
; // {
2454 // throw new NotImplementedException ();
2457 // throw new NotImplementedException ();
2461 public event EventHandler MouseEnter
; // {
2463 // throw new NotImplementedException ();
2466 // throw new NotImplementedException ();
2470 public event EventHandler MouseHover
; // {
2472 // throw new NotImplementedException ();
2475 // throw new NotImplementedException ();
2479 public event EventHandler MouseLeave
; // {
2481 // throw new NotImplementedException ();
2484 // throw new NotImplementedException ();
2489 public event MouseEventHandler MouseMove
; // {
2491 // throw new NotImplementedException ();
2494 // throw new NotImplementedException ();
2499 public event MouseEventHandler MouseUp
; // {
2501 // throw new NotImplementedException ();
2504 // throw new NotImplementedException ();
2508 public event MouseEventHandler MouseWheel
; // {
2510 // throw new NotImplementedException ();
2513 // throw new NotImplementedException ();
2517 public event EventHandler Move
; // {
2519 // throw new NotImplementedException ();
2522 // throw new NotImplementedException ();
2527 public event PaintEventHandler Paint
; // {
2529 // throw new NotImplementedException ();
2532 // throw new NotImplementedException ();
2537 public event EventHandler ParentChanged
; // {
2539 // throw new NotImplementedException ();
2542 // throw new NotImplementedException ();
2546 public event QueryAccessibilityHelpEventHandler QueryAccessibilityHelp
; // {
2548 // throw new NotImplementedException ();
2551 // throw new NotImplementedException ();
2555 public event QueryContinueDragEventHandler QueryContinueDrag
; // {
2557 // throw new NotImplementedException ();
2560 // throw new NotImplementedException ();
2565 public event EventHandler Resize
; // {
2567 // throw new NotImplementedException ();
2570 // throw new NotImplementedException ();
2574 public event EventHandler RightToLeftChanged
; // {
2576 // throw new NotImplementedException ();
2579 // throw new NotImplementedException ();
2583 public event EventHandler SizeChanged
; // {
2585 // throw new NotImplementedException ();
2588 // throw new NotImplementedException ();
2592 public event EventHandler StyleChanged
; // {
2594 // throw new NotImplementedException ();
2597 // throw new NotImplementedException ();
2601 public event EventHandler SystemColorsChanged
; // {
2603 // throw new NotImplementedException ();
2606 // throw new NotImplementedException ();
2610 public event EventHandler TabIndexChanged
; // {
2612 // throw new NotImplementedException ();
2615 // throw new NotImplementedException ();
2619 public event EventHandler TabStopChanged
; // {
2621 // throw new NotImplementedException ();
2624 // throw new NotImplementedException ();
2629 public event EventHandler TextChanged
; // {
2631 // throw new NotImplementedException ();
2634 // throw new NotImplementedException ();
2638 public event EventHandler Validated
; // {
2640 // throw new NotImplementedException ();
2643 // throw new NotImplementedException ();
2648 // CancelEventHandler not yet defined
2649 //public event CancelEventHandler Validating {
2651 // throw new NotImplementedException ();
2654 // throw new NotImplementedException ();
2658 public event EventHandler VisibleChanged
; // {
2660 // throw new NotImplementedException ();
2663 // throw new NotImplementedException ();
2667 /// --- IWin32Window properties
2668 public IntPtr Handle
{
2671 return window
.Handle
;
2676 /// --- ISynchronizeInvoke properties ---
2678 public bool InvokeRequired
{
2679 get { throw new NotImplementedException (); }
2682 /// --- ISynchronizeInvoke methods ---
2684 public IAsyncResult
BeginInvoke (Delegate method
)
2686 throw new NotImplementedException ();
2690 public IAsyncResult
BeginInvoke (Delegate method
,
2693 throw new NotImplementedException ();
2697 public object EndInvoke (IAsyncResult asyncResult
)
2699 throw new NotImplementedException ();
2704 public object Invoke (Delegate method
)
2706 throw new NotImplementedException ();
2710 public object Invoke (Delegate method
,object[] args
)
2712 throw new NotImplementedException ();
2715 /// sub-class: Control.ControlAccessibleObject
2717 /// Provides information about a control that can be used by an accessibility application.
2719 public class ControlAccessibleObject
/*: AccessibleObject*/ {
2720 // AccessibleObject not ready to be base class
2721 /// --- ControlAccessibleObject.constructor ---
2723 public ControlAccessibleObject (Control ownerControl
)
2725 throw new NotImplementedException ();
2729 /// --- ControlAccessibleObject Properties ---
2731 // public override string DefaultAction {
2732 // get { throw new NotImplementedException (); }
2736 // public override string Description {
2737 // get { throw new NotImplementedException (); }
2741 public IntPtr Handle
{
2742 get { throw new NotImplementedException (); }
2743 set { throw new NotImplementedException (); }
2747 // public override string Help {
2748 // get { throw new NotImplementedException (); }
2752 // public override string KeyboardShortcut {
2753 // get { throw new NotImplementedException (); }
2757 // public override string Name {
2758 // get { throw new NotImplementedException (); }
2759 // set { throw new NotImplementedException (); }
2763 public Control Owner
{
2764 get { throw new NotImplementedException (); }
2768 // public override AccessibleRole Role {
2769 // get { throw new NotImplementedException (); }
2773 /// --- ControlAccessibleObject Methods ---
2775 // public override int GetHelpTopic(out string fileName)
2777 // throw new NotImplementedException ();
2781 public void NotifyClients (AccessibleEvents accEvent
)
2783 throw new NotImplementedException ();
2787 public void NotifyClients (AccessibleEvents accEvent
,
2790 throw new NotImplementedException ();
2794 public override string ToString ()
2796 throw new NotImplementedException ();
2800 /// sub-class: Control.ControlCollection
2802 /// Represents a collection of Control objects
2804 public class ControlCollection
: IList
, ICollection
, IEnumerable
, ICloneable
{
2806 private ArrayList collection
= new ArrayList ();
2807 private Control owner
;
2809 /// --- ControlCollection.constructor ---
2810 public ControlCollection (Control owner
)
2815 /// --- ControlCollection Properties ---
2817 get { return collection.Count; }
2820 public bool IsReadOnly
{
2821 get { return collection.IsReadOnly; }
2824 public virtual Control
this [int index
] {
2825 get { return (Control) collection[index]; }
2828 public virtual void Add (Control
value)
2830 collection
.Add (value);
2833 public virtual void AddRange (Control
[] controls
)
2835 collection
.AddRange (controls
);
2838 public virtual void Clear ()
2840 collection
.Clear ();
2843 public bool Contains (Control control
)
2845 return collection
.Contains (control
);
2848 public void CopyTo (Array dest
,int index
)
2850 collection
.CopyTo (dest
, index
);
2854 public override bool Equals (object other
)
2856 throw new NotImplementedException ();
2860 //public static bool Equals(object o1, object o2) {
2861 // throw new NotImplementedException ();
2865 public int GetChildIndex (Control child
)
2867 throw new NotImplementedException ();
2870 public IEnumerator
GetEnumerator ()
2872 return collection
.GetEnumerator ();
2876 public override int GetHashCode ()
2878 throw new NotImplementedException ();
2881 public int IndexOf (Control control
)
2883 return collection
.IndexOf (control
);
2886 public virtual void Remove (Control
value)
2888 collection
.Remove (value);
2891 public void RemoveAt (int index
)
2893 collection
.RemoveAt (index
);
2897 public void SetChildIndex (Control child
,int newIndex
)
2899 throw new NotImplementedException ();
2902 /// --- ControlCollection.IClonable methods ---
2904 object ICloneable
.Clone ()
2906 throw new NotImplementedException ();
2909 /// --- ControlCollection.IList properties ---
2910 bool IList
.IsFixedSize
{
2911 get { return collection.IsFixedSize; }
2914 object IList
.this [int index
] {
2915 get { return collection[index]; }
2916 set { collection[index] = value; }
2919 object ICollection
.SyncRoot
{
2920 get { return collection.SyncRoot; }
2923 bool ICollection
.IsSynchronized
{
2924 get { return collection.IsSynchronized; }
2927 /// --- ControlCollection.IList methods ---
2928 int IList
.Add (object control
)
2930 return collection
.Add (control
);
2933 bool IList
.Contains (object control
)
2935 return collection
.Contains (control
);
2938 int IList
.IndexOf (object control
)
2940 return collection
.IndexOf (control
);
2943 void IList
.Insert (int index
,object value)
2945 collection
.Insert (index
, value);
2948 void IList
.Remove (object control
)
2950 collection
.Remove (control
);
2952 } // --- end of Control.ControlCollection ---