File: MdiFormHandleTest.cs

package info (click to toggle)
mono 4.6.2.7+dfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: stretch
  • size: 778,148 kB
  • ctags: 914,052
  • sloc: cs: 5,779,509; xml: 2,773,713; ansic: 432,645; sh: 14,749; makefile: 12,361; perl: 2,488; python: 1,434; cpp: 849; asm: 531; sql: 95; sed: 16; php: 1
file content (1496 lines) | stat: -rw-r--r-- 44,701 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
//
// FormTest.cs: Test cases for Form.
//
// Author:
//   Ritvik Mayank (mritvik@novell.com)
//
// (C) 2005 Novell, Inc. (http://www.novell.com)
//

using System;
using System.ComponentModel;
using System.Drawing;
using System.Reflection;
using System.Windows.Forms;

using NUnit.Framework;

using CategoryAttribute = NUnit.Framework.CategoryAttribute;

namespace MonoTests.System.Windows.Forms
{
	[TestFixture]
	public class MdiFormHandleTest : TestHelper
	{
		private ProtectedForm main;
		private ProtectedForm child1;
		private ProtectedForm child2;
		
		[TearDown]
		protected override void TearDown ()
		{
			if (main != null) {
				main.Dispose ();
				main = null;
			}
			
			if (child1 != null) {
				child1.Dispose ();
				child1 = null;
			}
			
			if (child2 != null) {
				child2.Dispose ();
				child2 = null;
			}
			base.TearDown ();
		}
		
		void SetUp ()
		{
			TearDown ();
			main = new ProtectedForm ();
			main.IsMdiContainer = true;
			main.ShowInTaskbar = false;

			child1 = new ProtectedForm ();
			child1.MdiParent = main;

			child2 = new ProtectedForm ();
			child2.MdiParent = main;
			
			main.Show ();
		}
		
		[Test]
		public void TestPublicProperties ()
		{
			// This long, carpal-tunnel syndrome inducing test shows us that
			// the following properties cause the Handle to be created:
			// - AccessibilityObject	[get]
			// - Capture			[set]
			// - Handle			[get]
			// - Visible			[set]

			// A
			SetUp ();
			object o = child1.AccessibilityObject;
			Assert.IsTrue (child1.IsHandleCreated, "A0");
			
			SetUp ();
			o = child1.AccessibleDefaultActionDescription;
			child1.AccessibleDefaultActionDescription = "playdoh";
			Assert.IsFalse (child1.IsHandleCreated, "A1");
			
			SetUp ();
			o = child1.AccessibleDescription;
			child1.AccessibleDescription = "more playdoh!";
			Assert.IsFalse (child1.IsHandleCreated, "A2");

			SetUp ();
			o = child1.AccessibleName;
			child1.AccessibleName = "playdoh fun factory";
			Assert.IsFalse (child1.IsHandleCreated, "A3");

			SetUp ();
			o = child1.AccessibleRole;
			child1.AccessibleRole = AccessibleRole.Border;
			Assert.IsFalse (child1.IsHandleCreated, "A4");

			SetUp ();
			o = child1.AllowDrop;
			child1.AllowDrop = true;
			Assert.IsFalse (child1.IsHandleCreated, "A5");
			
			// If we don't reset the control, handle creation will fail
			// because AllowDrop requires STAThread, which Nunit doesn't do

			SetUp ();
			o = child1.Anchor;
			child1.Anchor = AnchorStyles.Right;
			Assert.IsFalse (child1.IsHandleCreated, "A6");
#if !__MonoCS__
			SetUp ();
			o = child1.AutoScrollOffset;
			child1.AutoScrollOffset = new Point (40, 40);
			Assert.IsFalse (child1.IsHandleCreated, "A7");
#endif
			SetUp ();
			o = child1.AutoSize;
			child1.AutoSize = true;
			Assert.IsFalse (child1.IsHandleCreated, "A8");

			// A - Form	
			SetUp ();
			o = child1.AcceptButton;
			child1.AcceptButton = null;
			Assert.IsFalse (child1.IsHandleCreated, "FA1");

			SetUp ();
			o = child1.ActiveControl;
			child1.ActiveControl = null;
			Assert.IsFalse (child1.IsHandleCreated, "FA2");

			SetUp ();
			o = child1.ActiveMdiChild;
			Assert.IsFalse (child1.IsHandleCreated, "FA3");

			SetUp ();
			o = child1.AllowTransparency;
			child1.AllowTransparency = !child1.AllowTransparency;
			Assert.IsFalse (child1.IsHandleCreated, "FA4");

			SetUp ();
			o = child1.AutoScaleDimensions;
			child1.AutoScaleDimensions = SizeF.Empty;
			Assert.IsFalse (child1.IsHandleCreated, "FA5");

			SetUp ();
			o = child1.AutoScaleMode;
			child1.AutoScaleMode = AutoScaleMode.Dpi;
			Assert.IsFalse (child1.IsHandleCreated, "FA6");
			SetUp ();
			o = child1.AutoScroll;
			child1.AutoScroll = !child1.AutoScroll;
			Assert.IsFalse (child1.IsHandleCreated, "FA7");

			SetUp ();
			o = child1.AutoScrollMargin;
			child1.AutoScrollMargin = new Size (child1.AutoScrollMargin.Width + 1, child1.AutoScrollMargin.Height + 1);
			Assert.IsFalse (child1.IsHandleCreated, "FA8");

			SetUp ();
			o = child1.AutoScrollMinSize;
			child1.AutoScrollMinSize = new Size (child1.AutoScrollMinSize.Width + 1, child1.AutoScrollMinSize.Height + 1);
			Assert.IsFalse (child1.IsHandleCreated, "FA9");

#if !__MonoCS__
			SetUp ();
			o = child1.AutoScrollOffset;
			child1.AutoScrollOffset = new Point (child1.AutoScrollOffset.X + 1, child1.AutoScrollOffset.Y + 1);
			Assert.IsFalse (child1.IsHandleCreated, "FA10"); 
#endif

			SetUp ();
			o = child1.AutoScrollPosition;
			child1.AutoScrollPosition = new Point (child1.AutoScrollPosition.X + 1, child1.AutoScrollPosition.Y + 1);
			Assert.IsFalse (child1.IsHandleCreated, "FA11");

			SetUp ();
			o = child1.AutoSize;
			child1.AutoSize = !child1.AutoSize;
			Assert.IsFalse (child1.IsHandleCreated, "FA12");
#if !__MonoCS__
			SetUp ();
			o = child1.AutoSizeMode;
			child1.AutoSizeMode = AutoSizeMode.GrowAndShrink;
			Assert.IsFalse (child1.IsHandleCreated, "FA13");
#endif
			SetUp ();
			o = child1.AutoValidate;
			child1.AutoValidate = AutoValidate.EnableAllowFocusChange;
			Assert.IsFalse (child1.IsHandleCreated, "FA14");

			// B
			SetUp ();
			o = child1.BackColor;
			child1.BackColor = Color.Green;
			Assert.IsFalse (child1.IsHandleCreated, "A9");

			SetUp ();
			o = child1.BackgroundImage;
			child1.BackgroundImage = new Bitmap (1, 1);
			Assert.IsFalse (child1.IsHandleCreated, "A10");
			SetUp ();
			o = child1.BackgroundImageLayout;
			child1.BackgroundImageLayout = ImageLayout.Stretch;
			Assert.IsFalse (child1.IsHandleCreated, "A11");
			SetUp ();
			o = child1.BindingContext;
			child1.BindingContext = new BindingContext ();
			Assert.IsFalse (child1.IsHandleCreated, "A12");

			SetUp ();
			o = child1.Bottom;
			Assert.IsFalse (child1.IsHandleCreated, "A13");

			SetUp ();
			o = child1.Bounds;
			child1.Bounds = new Rectangle (0, 0, 12, 12);
			Assert.IsFalse (child1.IsHandleCreated, "A14");


			// B - Form
			SetUp ();
			o = child1.BindingContext;
			child1.BindingContext = null;
			Assert.IsFalse (child1.IsHandleCreated, "FB1");

			// C
			SetUp ();
			o = child1.CanFocus;
			Assert.IsFalse (child1.IsHandleCreated, "A15");

			SetUp ();
			o = child1.CanSelect;
			Assert.IsFalse (child1.IsHandleCreated, "A16");

			SetUp ();
			o = child1.Capture;
			Assert.IsFalse (child1.IsHandleCreated, "A17a");

			SetUp ();
			child1.Capture = true;
			Assert.IsTrue (child1.IsHandleCreated, "A17b");

			SetUp ();
			o = child1.CausesValidation;
			child1.CausesValidation = false;
			Assert.IsFalse (child1.IsHandleCreated, "A18");

			SetUp ();
			o = child1.ClientRectangle;
			Assert.IsFalse (child1.IsHandleCreated, "A19");

			SetUp ();
			o = child1.ClientSize;
			child1.ClientSize = new Size (30, 30);
			Assert.IsFalse (child1.IsHandleCreated, "A20");

			SetUp ();
			o = child1.CompanyName;
			Assert.IsFalse (child1.IsHandleCreated, "A21");

			SetUp ();
			o = child1.Container;
			Assert.IsFalse (child1.IsHandleCreated, "A22");

			SetUp ();
			o = child1.ContainsFocus;
			Assert.IsFalse (child1.IsHandleCreated, "A23");

			SetUp ();
			o = child1.ContextMenu;
			child1.ContextMenu = new ContextMenu ();
			Assert.IsFalse (child1.IsHandleCreated, "A24");

			SetUp ();
			o = child1.ContextMenuStrip;
			child1.ContextMenuStrip = new ContextMenuStrip ();
			Assert.IsFalse (child1.IsHandleCreated, "A25");
			SetUp ();
			o = child1.Controls;
			Assert.IsFalse (child1.IsHandleCreated, "A26");

			SetUp ();
			o = child1.Created;
			Assert.IsFalse (child1.IsHandleCreated, "A27");

			SetUp ();
			o = child1.Cursor;
			child1.Cursor = Cursors.Arrow;
			Assert.IsFalse (child1.IsHandleCreated, "A28");

			// C - Form
			SetUp ();
			o = child1.CancelButton;
			child1.CancelButton = null;
			Assert.IsFalse (child1.IsHandleCreated, "FC1");

			SetUp ();
			o = child1.ClientSize;
			child1.ClientSize = new Size (child1.ClientSize.Width + 1, child1.ClientSize.Height + 1);
			Assert.IsFalse (child1.IsHandleCreated, "FC2");

			SetUp ();
			o = child1.Container;
			Assert.IsFalse (child1.IsHandleCreated, "FC3");

			SetUp ();
			o = child1.ControlBox;
			child1.ControlBox = !child1.ControlBox;
			Assert.IsFalse (child1.IsHandleCreated, "FC4");

			SetUp ();
			o = child1.CurrentAutoScaleDimensions;
			Assert.IsFalse (child1.IsHandleCreated, "FC5"); 

			// D
			SetUp ();
			o = child1.DataBindings;
			Assert.IsFalse (child1.IsHandleCreated, "A29");

			SetUp ();
			o = child1.DisplayRectangle;
			Assert.IsFalse (child1.IsHandleCreated, "A30");

			SetUp ();
			o = child1.Disposing;
			Assert.IsFalse (child1.IsHandleCreated, "A31");

			SetUp ();
			o = child1.Dock;
			child1.Dock = DockStyle.Fill;
			Assert.IsFalse (child1.IsHandleCreated, "A32");

			// D - Form
			SetUp ();
			o = child1.DataBindings;
			Assert.IsFalse (child1.IsHandleCreated, "FD6");

			SetUp ();
			o = child1.DesktopBounds;
			child1.DesktopBounds = new Rectangle (3, 5, child1.DesktopBounds.Width + 1, child1.DesktopBounds.Height + 1);
			Assert.IsFalse (child1.IsHandleCreated, "FD7");

			SetUp ();
			o = child1.DesktopLocation;
			child1.DesktopLocation = child1.DesktopLocation + new Size (1, 1);
			Assert.IsFalse (child1.IsHandleCreated, "FD8");

			SetUp ();
			o = child1.DialogResult;
			child1.DialogResult = DialogResult.Abort;
			Assert.IsFalse (child1.IsHandleCreated, "FD9");

			SetUp ();
			o = child1.DisplayRectangle;
			Assert.IsFalse (child1.IsHandleCreated, "FD10");

			SetUp ();
			o = child1.Disposing;
			Assert.IsFalse (child1.IsHandleCreated, "FD11");

			SetUp ();
			o = child1.Dock;
			child1.Dock = DockStyle.Right;
			Assert.IsFalse (child1.IsHandleCreated, "FD12");

			// E-H
			SetUp ();
			o = child1.Enabled;
			child1.Enabled = false;
			Assert.IsFalse (child1.IsHandleCreated, "A33");

			SetUp ();
			o = child1.Focused;
			Assert.IsFalse (child1.IsHandleCreated, "A34");

			SetUp ();
			o = child1.Font;
			child1.Font = new Font (child1.Font, FontStyle.Bold);
			Assert.IsFalse (child1.IsHandleCreated, "A35");

			SetUp ();
			o = child1.ForeColor;
			child1.ForeColor = Color.Green;
			Assert.IsFalse (child1.IsHandleCreated, "A36");

			SetUp ();
			o = child1.Handle;
			Assert.IsTrue (child1.IsHandleCreated, "A37");

			SetUp ();
			o = child1.HasChildren;
			Assert.IsFalse (child1.IsHandleCreated, "A38");

			SetUp ();
			o = child1.Height;
			child1.Height = 12;
			Assert.IsFalse (child1.IsHandleCreated, "A39");

			// E-H - Form
			SetUp ();
			o = child1.FormBorderStyle;
			child1.FormBorderStyle = FormBorderStyle.FixedToolWindow;
			Assert.IsFalse (child1.IsHandleCreated, "FF1");

			SetUp ();
			o = child1.HelpButton;
			child1.HelpButton = !child1.HelpButton;
			Assert.IsFalse (child1.IsHandleCreated, "FH1");

#if !__MonoCS__
			SetUp ();
			o = child1.HorizontalScroll;
			Assert.IsFalse (child1.IsHandleCreated, "FH2"); 
#endif
			// I - L
			SetUp ();
			child1.ImeMode = ImeMode.On;
			Assert.IsFalse (child1.IsHandleCreated, "A40");

			SetUp ();
			o = child1.InvokeRequired;
			Assert.IsFalse (child1.IsHandleCreated, "A41");

			SetUp ();
			o = child1.IsAccessible;
			Assert.IsFalse (child1.IsHandleCreated, "A42");

			SetUp ();
			o = child1.IsDisposed;
			Assert.IsFalse (child1.IsHandleCreated, "A43");
#if !__MonoCS__
			SetUp ();
			o = child1.IsMirrored;
			Assert.IsFalse (child1.IsHandleCreated, "A44");
#endif
			SetUp ();
			o = child1.LayoutEngine;
			Assert.IsFalse (child1.IsHandleCreated, "A45");
			SetUp ();
			o = child1.Left;
			child1.Left = 15;
			Assert.IsFalse (child1.IsHandleCreated, "A46");

			SetUp ();
			o = child1.Location;
			child1.Location = new Point (20, 20);
			Assert.IsFalse (child1.IsHandleCreated, "A47");

			// I - L - Form

			SetUp ();
			o = child1.Icon;
			child1.Icon = null;
			Assert.IsFalse (child1.IsHandleCreated, "FI1");

			SetUp ();
			o = child1.IsMdiChild;
			Assert.IsFalse (child1.IsHandleCreated, "FI2");

			SetUp ();
			o = child1.IsMdiContainer;
			child1.IsMdiContainer = false;
			Assert.IsFalse (child1.IsHandleCreated, "FI3");

			SetUp ();
			o = child1.IsRestrictedWindow;
			Assert.IsFalse (child1.IsHandleCreated, "FI4");

			SetUp ();
			o = child1.KeyPreview;
			child1.KeyPreview = !child1.KeyPreview;
			Assert.IsFalse (child1.IsHandleCreated, "FK1");

			SetUp ();
			o = child1.Location;
			child1.Location = child1.Location + new Size (1, 1);
			Assert.IsFalse (child1.IsHandleCreated, "FL1");
			
			
			// M - N
			SetUp ();
			o = child1.Margin;
			child1.Margin = new Padding (6);
			Assert.IsFalse (child1.IsHandleCreated, "A48");

			SetUp ();
			o = child1.MaximumSize;
			child1.MaximumSize = new Size (500, 500);
			Assert.IsFalse (child1.IsHandleCreated, "A49");

			SetUp ();
			o = child1.MinimumSize;
			child1.MinimumSize = new Size (100, 100);
			Assert.IsFalse (child1.IsHandleCreated, "A50");
			SetUp ();
			o = child1.Name;
			child1.Name = "web";
			Assert.IsFalse (child1.IsHandleCreated, "A51");

			// M - O - Form
			SetUp ();
			o = child1.MainMenuStrip;
			child1.MainMenuStrip = null;
			Assert.IsFalse (child1.IsHandleCreated, "FM1"); 

			SetUp ();
			o = child1.MaximizeBox;
			child1.MaximizeBox = !child1.MaximizeBox;
			Assert.IsFalse (child1.IsHandleCreated, "FM2");

			SetUp ();
			o = child1.MaximumSize;
			child1.MaximumSize = child1.MaximumSize + new Size (1, 1);
			Assert.IsFalse (child1.IsHandleCreated, "FM3");

			SetUp ();
			o = child1.MdiChildren;
			Assert.IsFalse (child1.IsHandleCreated, "FM4");

			SetUp ();
			o = child1.MdiParent;
			child1.MdiParent = null;
			Assert.IsFalse (child1.IsHandleCreated, "FM5");

			SetUp ();
			o = child1.Menu;
			child1.Menu = null;
			Assert.IsFalse (child1.IsHandleCreated, "FM6");

			SetUp ();
			o = child1.MergedMenu;
			Assert.IsFalse (child1.IsHandleCreated, "FM7");

			SetUp ();
			o = child1.MinimizeBox;
			child1.MinimizeBox = !child1.MinimizeBox;
			Assert.IsFalse (child1.IsHandleCreated, "FM8");

			SetUp ();
			o = child1.MinimumSize;
			child1.MinimumSize = child1.MinimumSize + new Size (1, 1);
			Assert.IsFalse (child1.IsHandleCreated, "FM9");

			SetUp ();
			o = child1.Modal;
			Assert.IsFalse (child1.IsHandleCreated, "FM10");

			SetUp ();
			o = child1.Opacity;
			child1.Opacity = 0.9;
			Assert.IsFalse (child1.IsHandleCreated, "FO1");

			SetUp ();
			o = child1.OwnedForms;
			Assert.IsFalse (child1.IsHandleCreated, "FO2");

			SetUp ();
			o = child1.Owner;
			child1.Owner = null;
			Assert.IsFalse (child1.IsHandleCreated, "FO3");
			
			// P - R
			SetUp ();
			o = child1.Padding;
			child1.Padding = new Padding (4);
			Assert.IsFalse (child1.IsHandleCreated, "A52");
			try {
				SetUp ();
				o = child1.Parent;
				child1.TopLevel = false;
				child1.Parent = new Form ();
				Assert.Fail ("A53 - Expected ArgumentException, got no exception");
			} catch (ArgumentException ex) {
				TestHelper.RemoveWarning (ex);
			} catch (Exception ex) {
				Assert.Fail ("A53 - Expected ArgumentException, got " + ex.GetType ().Name);
			} finally {
				Assert.IsFalse (child1.IsHandleCreated, "A53");
			}
			SetUp ();
			o = child1.PreferredSize;
			Assert.IsFalse (child1.IsHandleCreated, "A54");
			SetUp ();
			o = child1.ProductName;
			Assert.IsFalse (child1.IsHandleCreated, "A55");

			SetUp ();
			o = child1.ProductVersion;
			Assert.IsFalse (child1.IsHandleCreated, "A56");

			SetUp ();
			o = child1.RecreatingHandle;
			Assert.IsFalse (child1.IsHandleCreated, "A57");

			SetUp ();
			o = child1.Region;
			child1.Region = new Region (new Rectangle (0, 0, 177, 177));
			Assert.IsFalse (child1.IsHandleCreated, "A58");

			SetUp ();
			o = child1.Right;
			Assert.IsFalse (child1.IsHandleCreated, "A59");

			SetUp ();
			o = child1.RightToLeft;
			child1.RightToLeft = RightToLeft.Yes;
			Assert.IsFalse (child1.IsHandleCreated, "A60");

			// P - R - Form
			SetUp ();
			o = child1.ParentForm;
			Assert.IsFalse (child1.IsHandleCreated, "FP1");

#if !__MonoCS__
			SetUp ();
			o = child1.RestoreBounds;
			Assert.IsFalse (child1.IsHandleCreated, "FR1"); 
#endif


			// S - W
			SetUp ();
			o = child1.Site;
			Assert.IsFalse (child1.IsHandleCreated, "A61");

			SetUp ();
			o = child1.Size;
			child1.Size = new Size (188, 188);
			Assert.IsFalse (child1.IsHandleCreated, "A62");

			SetUp ();
			o = child1.TabIndex;
			child1.TabIndex = 5;
			Assert.IsFalse (child1.IsHandleCreated, "A63");

			SetUp ();
			o = child1.Tag;
			child1.Tag = "moooooooo";
			Assert.IsFalse (child1.IsHandleCreated, "A64");

			SetUp ();
			o = child1.Text;
			child1.Text = "meoooowww";
			Assert.IsFalse (child1.IsHandleCreated, "A65");

			SetUp ();
			o = child1.Top;
			child1.Top = 16;
			Assert.IsFalse (child1.IsHandleCreated, "A66");

			SetUp ();
			o = child1.TopLevelControl;
			Assert.IsFalse (child1.IsHandleCreated, "A67");
#if !__MonoCS__
			SetUp ();
			o = child1.UseWaitCursor;
			child1.UseWaitCursor = true;
			Assert.IsFalse (child1.IsHandleCreated, "A68");
#endif
			SetUp ();
			o = child1.Visible;
			Assert.IsFalse (child1.IsHandleCreated, "A69-a");
			
			SetUp ();
			child1.Visible = true;
			Assert.IsTrue (child1.IsHandleCreated, "A69-b");
			
			SetUp ();
			o = child1.Width;
			child1.Width = 190;
			Assert.IsFalse (child1.IsHandleCreated, "A70");

			SetUp ();
			o = child1.WindowTarget;
			Assert.IsFalse (child1.IsHandleCreated, "A71");

			// S - W - Form

			SetUp ();
			o = child1.ShowIcon;
			child1.ShowIcon = !child1.ShowIcon;
			Assert.IsFalse (child1.IsHandleCreated, "FS1"); 

			SetUp ();
			o = child1.ShowInTaskbar;
			child1.ShowInTaskbar = !child1.ShowInTaskbar;
			Assert.IsFalse (child1.IsHandleCreated, "FS2");

			SetUp ();
			o = child1.Size;
			child1.Size = child1.Size + new Size (1, 1);
			Assert.IsFalse (child1.IsHandleCreated, "FS3");

			SetUp ();
			o = child1.SizeGripStyle;
			child1.SizeGripStyle = SizeGripStyle.Show;
			Assert.IsFalse (child1.IsHandleCreated, "FS4");

			SetUp ();
			o = child1.StartPosition;
			child1.StartPosition = FormStartPosition.Manual;
			Assert.IsFalse (child1.IsHandleCreated, "FS5");

			SetUp ();
			o = child1.Text;
			child1.Text = "hooray!";
			Assert.IsFalse (child1.IsHandleCreated, "FT1");

			try {
				SetUp ();
				o = child1.TopLevel;
				child1.TopLevel = !child1.TopLevel;
				Assert.Fail ("FT2 - expected ArgumentException, got no exception.");
			} catch (ArgumentException ex) {
				TestHelper.RemoveWarning (ex);
			} catch (Exception ex) {
				Assert.Fail ("FT2 - expected ArgumentException, got " + ex.GetType ().Name);
			} finally {
				Assert.IsFalse (child1.IsHandleCreated, "FT2");
			}

			SetUp ();
			o = child1.TopMost;
			child1.TopMost = !child1.TopMost;
			Assert.IsFalse (child1.IsHandleCreated, "FT3");

			SetUp ();
			o = child1.TransparencyKey;
			child1.TransparencyKey = Color.BurlyWood;
			Assert.IsFalse (child1.IsHandleCreated, "FT4");

#if !__MonoCS__
			SetUp ();
			o = child1.VerticalScroll;
			Assert.IsFalse (child1.IsHandleCreated, "FV1"); 
#endif

			SetUp ();
			o = child1.WindowState;
			child1.WindowState = FormWindowState.Maximized;
			Assert.IsFalse (child1.IsHandleCreated, "FW1");

			TestHelper.RemoveWarning (o);
		}

		[Test]
		public void TestProtectedProperties ()
		{
			// Not a surprise, but none of these cause handle creation.
			// Included just to absolutely certain.
			object o;
#if !__MonoCS__
			SetUp ();
			o = child1.PublicCanRaiseEvents;
			Assert.IsFalse (child1.IsHandleCreated, "A1");
#endif
			SetUp ();
			o = child1.PublicCreateParams;
			Assert.IsFalse (child1.IsHandleCreated, "A2");
			SetUp ();
			o = child1.PublicDefaultCursor;
			Assert.IsFalse (child1.IsHandleCreated, "A3");
			SetUp ();
			o = child1.PublicDefaultImeMode;
			Assert.IsFalse (child1.IsHandleCreated, "A4");
			SetUp ();
			o = child1.PublicDefaultMargin;
			Assert.IsFalse (child1.IsHandleCreated, "A5");
			
			SetUp ();
			o = child1.PublicDefaultMaximumSize;
			Assert.IsFalse (child1.IsHandleCreated, "A6");

			SetUp ();
			o = child1.PublicDefaultMinimumSize;
			Assert.IsFalse (child1.IsHandleCreated, "A7");

			SetUp ();
			o = child1.PublicDefaultPadding;
			Assert.IsFalse (child1.IsHandleCreated, "A8");

			SetUp ();
			o = child1.PublicDefaultSize;
			Assert.IsFalse (child1.IsHandleCreated, "A9");

			SetUp ();
			o = child1.PublicDoubleBuffered;
			child1.PublicDoubleBuffered = !child1.PublicDoubleBuffered;
			Assert.IsFalse (child1.IsHandleCreated, "A10");
			SetUp ();
			o = child1.PublicFontHeight;
			child1.PublicFontHeight = child1.PublicFontHeight + 1;
			Assert.IsFalse (child1.IsHandleCreated, "A11");

			SetUp ();
			o = child1.PublicRenderRightToLeft;
			Assert.IsFalse (child1.IsHandleCreated, "A12");

			SetUp ();
			o = child1.PublicResizeRedraw;
			child1.PublicResizeRedraw = !child1.PublicResizeRedraw;
			Assert.IsFalse (child1.IsHandleCreated, "A13");
#if !__MonoCS__
			SetUp ();
			o = child1.PublicScaleChildren;
			Assert.IsFalse (child1.IsHandleCreated, "A14");
#endif
			SetUp ();
			o = child1.PublicShowFocusCues;
			Assert.IsFalse (child1.IsHandleCreated, "A15");

			SetUp ();
			o = child1.PublicShowKeyboardCues;
			Assert.IsFalse (child1.IsHandleCreated, "A16");

			SetUp ();
			o = child1.PublicAutoScaleFactor;
			Assert.IsFalse (child1.IsHandleCreated, "F1"); 
			SetUp ();
			o = child1.PublicDesignMode;
			Assert.IsFalse (child1.IsHandleCreated, "F2");

			SetUp ();
			o = child1.PublicEvents;
			Assert.IsFalse (child1.IsHandleCreated, "F3");

			SetUp ();
			o = child1.PublicHScroll;
			child1.PublicHScroll = !child1.PublicHScroll;
			Assert.IsFalse (child1.IsHandleCreated, "F4");

			SetUp ();
			o = child1.PublicMaximizedBounds;
			child1.PublicMaximizedBounds = new Rectangle (1, 1, 1, 1);
			Assert.IsFalse (child1.IsHandleCreated, "F5");

			SetUp ();
			o = child1.PublicShowWithoutActivation;
			Assert.IsFalse (child1.IsHandleCreated, "F6"); 
			SetUp ();
			o = child1.PublicVScroll;
			child1.PublicVScroll = !child1.PublicVScroll;
			Assert.IsFalse (child1.IsHandleCreated, "F7");
			

			TestHelper.RemoveWarning (o);
		}

		[Test]
		public void TestPublicMethods ()
		{
			// Public Methods that force Handle creation:
			// - CreateGraphics ()
			// - Focus ()
			// - GetChildAtPoint ()
			// - PointToClient ()
			// - PointToScreen ()
			// - RectangleToClient ()
			// - RectangleToScreen ()
			// - Select ()
			
			SetUp ();
			child1.BringToFront ();
			Assert.IsFalse (child1.IsHandleCreated, "A1");

			SetUp ();
			child1.Contains (new Form ());
			Assert.IsFalse (child1.IsHandleCreated, "A2");

			SetUp ();
			child1.CreateControl ();
			Assert.IsFalse (child1.IsHandleCreated, "A3");

			SetUp ();
			Graphics g = child1.CreateGraphics ();
			Assert.IsTrue (child1.IsHandleCreated, "A4");
			g.Dispose ();

			SetUp ();
			child1.Dispose ();
			Assert.IsFalse (child1.IsHandleCreated, "A5");

			// This is weird, it causes a form to appear that won't go away until you move the mouse over it, 
			// but it doesn't create a handle??
			//DragDropEffects d = c.DoDragDrop ("yo", DragDropEffects.None);
			//Assert.IsFalse (c.IsHandleCreated, "A6");
			//Assert.AreEqual (DragDropEffects.None, d, "A6b");
			
			//Bitmap b = new Bitmap (100, 100);
			//c.DrawToBitmap (b, new Rectangle (0, 0, 100, 100));
			//Assert.IsFalse (c.IsHandleCreated, "A7");
			//b.Dispose ();
			SetUp ();
			child1.FindForm ();
			Assert.IsFalse (child1.IsHandleCreated, "A8");

			SetUp ();
			child1.Focus ();
			Assert.IsTrue (child1.IsHandleCreated, "A9");

			SetUp ();
			child1.GetChildAtPoint (new Point (10, 10));
			Assert.IsTrue (child1.IsHandleCreated, "A10");

			SetUp ();
			child1.GetContainerControl ();
			Assert.IsFalse (child1.IsHandleCreated, "A11");
			
			SetUp ();
			child1.GetNextControl (new Control (), true);
			Assert.IsFalse (child1.IsHandleCreated, "A12");
			SetUp ();
			child1.GetPreferredSize (Size.Empty);
			Assert.IsFalse (child1.IsHandleCreated, "A13");
			SetUp ();
			child1.Hide ();
			Assert.IsFalse (child1.IsHandleCreated, "A14");

			SetUp ();
			child1.Invalidate ();
			Assert.IsFalse (child1.IsHandleCreated, "A15");

			child1.Invoke (new InvokeDelegate (InvokeMethod));
			Assert.IsFalse (child1.IsHandleCreated, "A16");
			
			SetUp ();
			child1.PerformLayout ();
			Assert.IsFalse (child1.IsHandleCreated, "A17");

			SetUp ();
			child1.PointToClient (new Point (100, 100));
			Assert.IsTrue (child1.IsHandleCreated, "A18");

			SetUp ();
			child1.PointToScreen (new Point (100, 100));
			Assert.IsTrue (child1.IsHandleCreated, "A19");
			
			//c.PreProcessControlMessage   ???
			//c.PreProcessMessage          ???
			SetUp ();
			child1.RectangleToClient (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (child1.IsHandleCreated, "A20");
			
			SetUp ();
			child1.RectangleToScreen (new Rectangle (0, 0, 100, 100));
			Assert.IsTrue (child1.IsHandleCreated, "A21");

			SetUp ();
			child1.Refresh ();
			Assert.IsFalse (child1.IsHandleCreated, "A22");

			SetUp ();
			child1.ResetBackColor ();
			Assert.IsFalse (child1.IsHandleCreated, "A23");

			SetUp ();
			child1.ResetBindings ();
			Assert.IsFalse (child1.IsHandleCreated, "A24");

			SetUp ();
			child1.ResetCursor ();
			Assert.IsFalse (child1.IsHandleCreated, "A25");

			SetUp ();
			child1.ResetFont ();
			Assert.IsFalse (child1.IsHandleCreated, "A26");

			SetUp ();
			child1.ResetForeColor ();
			Assert.IsFalse (child1.IsHandleCreated, "A27");

			SetUp ();
			child1.ResetImeMode ();
			Assert.IsFalse (child1.IsHandleCreated, "A28");

			SetUp ();
			child1.ResetRightToLeft ();
			Assert.IsFalse (child1.IsHandleCreated, "A29");

			SetUp ();
			child1.ResetText ();
			Assert.IsFalse (child1.IsHandleCreated, "A30");

			SetUp ();
			child1.SuspendLayout ();
			Assert.IsFalse (child1.IsHandleCreated, "A31");

			SetUp ();
			child1.ResumeLayout ();
			Assert.IsFalse (child1.IsHandleCreated, "A32");
			
			SetUp ();
			child1.Scale (new SizeF (1.5f, 1.5f));
			Assert.IsFalse (child1.IsHandleCreated, "A33");
			SetUp ();
			child1.Select ();
			Assert.IsTrue (child1.IsHandleCreated, "A34");

			SetUp ();
			child1.SelectNextControl (new Control (), true, true, true, true);
			Assert.IsFalse (child1.IsHandleCreated, "A35");

			SetUp ();
			child1.SetBounds (0, 0, 100, 100);
			Assert.IsFalse (child1.IsHandleCreated, "A36");

			SetUp ();
			child1.Update ();
			Assert.IsFalse (child1.IsHandleCreated, "A37");

			// Form

			SetUp ();
			child1.Activate ();
			Assert.IsFalse (child1.IsHandleCreated, "F1");

			SetUp ();
			child1.AddOwnedForm (new Form ());
			Assert.IsFalse (child1.IsHandleCreated, "F2");

			SetUp ();
			child1.Close ();
			Assert.IsFalse (child1.IsHandleCreated, "F3");

			SetUp ();
			child1.Hide ();
			Assert.IsFalse (child1.IsHandleCreated, "F4");

			SetUp ();
			child1.LayoutMdi (MdiLayout.Cascade);
			Assert.IsFalse (child1.IsHandleCreated, "F5");

#if !__MonoCS__
			SetUp ();
			child1.PerformAutoScale ();
			Assert.IsFalse (child1.IsHandleCreated, "F6");
#endif

			SetUp ();
			child1.PerformLayout ();
			Assert.IsFalse (child1.IsHandleCreated, "F7");

			SetUp ();
			child1.AddOwnedForm (new Form ());
			child1.RemoveOwnedForm (child1.OwnedForms [child1.OwnedForms.Length - 1]);
			Assert.IsFalse (child1.IsHandleCreated, "F8");

			SetUp ();
			child1.ScrollControlIntoView (null);
			Assert.IsFalse (child1.IsHandleCreated, "F9");

			SetUp ();
			child1.SetAutoScrollMargin (7, 13);
			Assert.IsFalse (child1.IsHandleCreated, "F10");

			SetUp ();
			child1.SetDesktopBounds (-1, -1, 144, 169);
			Assert.IsFalse (child1.IsHandleCreated, "F11");

			SetUp ();
			child1.SetDesktopLocation (7, 13);
			Assert.IsFalse (child1.IsHandleCreated, "F12");

			try {
				SetUp ();
				child1.Show (null);
				Assert.Fail ("F13 - expected InvalidOperationException, got no exception.");
			} catch (InvalidOperationException ex) {
				TestHelper.RemoveWarning (ex);
			} catch (Exception ex) {
				Assert.Fail ("F13 - expected InvalidOperationException, got " + ex.GetType ().Name);
			} finally {
				Assert.IsFalse (child1.IsHandleCreated, "F13");
			}
			
			//c.ShowDialog ()

			SetUp ();
			child1.ToString ();
			Assert.IsFalse (child1.IsHandleCreated, "F14");

			SetUp ();
			child1.Validate ();
			Assert.IsFalse (child1.IsHandleCreated, "F15");

#if !__MonoCS__
			SetUp ();
			child1.ValidateChildren ();
			Assert.IsFalse (child1.IsHandleCreated, "F16"); 
#endif
		}

		[Test]
		public void Show ()
		{
			SetUp ();
			Assert.IsFalse (child1.IsHandleCreated, "A1");
			child1.HandleCreated += new EventHandler (HandleCreated_WriteStackTrace);
			child1.Show ();
			Assert.IsTrue (child1.IsHandleCreated, "A2");
		}

		void HandleCreated_WriteStackTrace (object sender, EventArgs e)
		{
			Console.WriteLine ("Stacktrace?");//Environment.StackTrace);
		}

		public delegate void InvokeDelegate ();
		public void InvokeMethod () { invokeform.Text = "methodinvoked"; }

		Form invokeform = new Form ();

		[Test]
		public void TestProtectedMethods ()
		{
			// Protected Methods that force Handle creation:
			// - CreateAccessibilityInstance ()
			// - CreateHandle ()
			// - IsInputChar ()
			// - Select ()
			// - SetVisibleCore ()
			
			SetUp ();
			child1.PublicAccessibilityNotifyClients (AccessibleEvents.Focus, 0);
			Assert.IsFalse (child1.IsHandleCreated, "A1");
			child1.PublicCreateAccessibilityInstance ();
			Assert.IsTrue (child1.IsHandleCreated, "A2");

			SetUp ();
			child1.PublicCreateControlsInstance ();
			Assert.IsFalse (child1.IsHandleCreated, "A3");

			SetUp ();
			child1.PublicCreateHandle ();
			Assert.IsTrue (child1.IsHandleCreated, "A4");

			SetUp ();
			child1.PublicDestroyHandle ();
			Assert.IsFalse (child1.IsHandleCreated, "A5");

			SetUp ();
			child1.PublicGetAccessibilityObjectById (0);
			Assert.IsFalse (child1.IsHandleCreated, "A6");
#if !__MonoCS__
			SetUp ();
			child1.PublicGetAutoSizeMode ();
			Assert.IsFalse (child1.IsHandleCreated, "A7");

			SetUp ();
			child1.PublicGetScaledBounds (new Rectangle (0, 0, 100, 100), new SizeF (1.5f, 1.5f), BoundsSpecified.All);
			Assert.IsFalse (child1.IsHandleCreated, "A8");
#endif
			SetUp ();
			child1.PublicGetStyle (ControlStyles.FixedHeight);
			Assert.IsFalse (child1.IsHandleCreated, "A9");

			SetUp ();
			child1.PublicGetTopLevel ();
			Assert.IsFalse (child1.IsHandleCreated, "A10");

			SetUp ();
			child1.PublicInitLayout ();
			Assert.IsFalse (child1.IsHandleCreated, "A11");

			SetUp ();
			child1.PublicInvokeGotFocus (child1, EventArgs.Empty);
			Assert.IsFalse (child1.IsHandleCreated, "A12");

			SetUp ();
			child1.PublicInvokeLostFocus (child1, EventArgs.Empty);
			Assert.IsFalse (child1.IsHandleCreated, "A13");

			SetUp ();
			child1.PublicInvokeOnClick (child1, EventArgs.Empty);
			Assert.IsFalse (child1.IsHandleCreated, "A14");

			SetUp ();
			child1.PublicInvokePaint (child1, new PaintEventArgs (Graphics.FromImage (new Bitmap (1, 1)), Rectangle.Empty));
			Assert.IsFalse (child1.IsHandleCreated, "A15");

			SetUp ();
			child1.PublicInvokePaintBackground (child1, new PaintEventArgs (Graphics.FromImage (new Bitmap (1, 1)), Rectangle.Empty));
			Assert.IsFalse (child1.IsHandleCreated, "A16");

			SetUp ();
			child1.PublicIsInputChar ('c');
			Assert.IsTrue (child1.IsHandleCreated, "A17");

			SetUp ();
			child1.PublicIsInputKey (Keys.B);
			Assert.IsFalse (child1.IsHandleCreated, "A18");

			SetUp ();
			child1.PublicNotifyInvalidate (Rectangle.Empty);
			Assert.IsFalse (child1.IsHandleCreated, "A19");

			SetUp ();
			child1.PublicOnVisibleChanged (EventArgs.Empty);
			Assert.IsFalse (child1.IsHandleCreated, "A20");

			SetUp ();
			child1.PublicRaiseDragEvent (null, null);
			Assert.IsFalse (child1.IsHandleCreated, "A21");

			SetUp ();
			child1.PublicRaiseKeyEvent (null, null);
			Assert.IsFalse (child1.IsHandleCreated, "A22");

			SetUp ();
			child1.PublicRaiseMouseEvent (null, null);
			Assert.IsFalse (child1.IsHandleCreated, "A23");

			SetUp ();
			child1.PublicRaisePaintEvent (null, null);
			Assert.IsFalse (child1.IsHandleCreated, "A24");

			SetUp ();
			child1.PublicRecreateHandle ();
			Assert.IsFalse (child1.IsHandleCreated, "A25");

			SetUp ();
			child1.PublicResetMouseEventArgs ();
			Assert.IsFalse (child1.IsHandleCreated, "A26");

			SetUp ();
			child1.PublicRtlTranslateAlignment (ContentAlignment.BottomLeft);
			Assert.IsFalse (child1.IsHandleCreated, "A27");

			SetUp ();
			child1.PublicRtlTranslateContent (ContentAlignment.BottomLeft);
			Assert.IsFalse (child1.IsHandleCreated, "A28");

			SetUp ();
			child1.PublicRtlTranslateHorizontal (HorizontalAlignment.Left);
			Assert.IsFalse (child1.IsHandleCreated, "A29");

			SetUp ();
			child1.PublicRtlTranslateLeftRight (LeftRightAlignment.Left);
			Assert.IsFalse (child1.IsHandleCreated, "A30");
#if !__MonoCS__
			SetUp ();
			child1.PublicScaleControl (new SizeF (1.5f, 1.5f), BoundsSpecified.All);
			Assert.IsFalse (child1.IsHandleCreated, "A31");
#endif
			SetUp ();
			child1.PublicScaleCore (1.5f, 1.5f);
			Assert.IsFalse (child1.IsHandleCreated, "A32");

			SetUp ();
			child1.PublicSelect ();
			Assert.IsTrue (child1.IsHandleCreated, "A33");
			
#if !__MonoCS__
			SetUp ();
			child1.PublicSetAutoSizeMode (AutoSizeMode.GrowAndShrink);
			Assert.IsFalse (child1.IsHandleCreated, "A34");
#endif
			SetUp ();
			child1.PublicSetBoundsCore (0, 0, 100, 100, BoundsSpecified.All);
			Assert.IsFalse (child1.IsHandleCreated, "A35");

			SetUp ();
			child1.PublicSetClientSizeCore (122, 122);
			Assert.IsFalse (child1.IsHandleCreated, "A36");

			SetUp ();
			child1.PublicSetStyle (ControlStyles.FixedHeight, true);
			Assert.IsFalse (child1.IsHandleCreated, "A37");

			try {
				SetUp ();
				child1.PublicSetTopLevel (true);
				Assert.Fail ("A38, expected ArgumentException, got no exception");
			} catch (ArgumentException ex) {
				TestHelper.RemoveWarning (ex);
			} catch (Exception ex) {
				Assert.Fail ("A38, expected ArgumentException, got " + ex.GetType ().Name);
			} finally {
				Assert.IsFalse (child1.IsHandleCreated, "A38");
			}

			SetUp ();
			child1.PublicSetVisibleCore (true);
			Assert.IsTrue (child1.IsHandleCreated, "A39");
			SetUp ();
			child1.PublicSizeFromClientSize (new Size (160, 160));
			Assert.IsFalse (child1.IsHandleCreated, "A40");

			SetUp ();
			child1.PublicUpdateBounds ();
			Assert.IsFalse (child1.IsHandleCreated, "A41");

			SetUp ();
			child1.PublicUpdateStyles ();
			Assert.IsFalse (child1.IsHandleCreated, "A42");

			SetUp ();
			child1.PublicUpdateZOrder ();
			Assert.IsFalse (child1.IsHandleCreated, "A43");


			// Form

			SetUp ();
			main.PublicActivateMdiChild (child1);
			main.PublicActivateMdiChild (child2);
			Assert.IsFalse (child1.IsHandleCreated, "F1-a");
			Assert.IsFalse (child2.IsHandleCreated, "F1-b");

			SetUp ();
			child1.PublicAdjustFormScrollbars (true);
			Assert.IsFalse (child1.IsHandleCreated, "F2");

			SetUp ();
			child1.PublicCenterToParent ();
			Assert.IsFalse (child1.IsHandleCreated, "F3");

			SetUp ();
			child1.PublicCenterToScreen ();
			Assert.IsFalse (child1.IsHandleCreated, "F4");

			SetUp ();
			child1.PublicGetScrollState (1);
			Assert.IsFalse (child1.IsHandleCreated, "F5");

			SetUp ();
			child1.PublicGetService (typeof (int));
			Assert.IsFalse (child1.IsHandleCreated, "F6");

			SetUp ();
			Message m = new Message ();
			child1.PublicProcessCmdKey (ref m, Keys.C);
			Assert.IsFalse (child1.IsHandleCreated, "F7");

			SetUp ();
			child1.PublicProcessDialogChar ('p');
			Assert.IsFalse (child1.IsHandleCreated, "F8");

			SetUp ();
			child1.PublicProcessDialogKey (Keys.D);
			Assert.IsFalse (child1.IsHandleCreated, "F9");

			SetUp ();
			child1.PublicProcessKeyEventArgs (ref m);
			Assert.IsFalse (child1.IsHandleCreated, "F10");

			SetUp ();
			child1.PublicProcessKeyMessage (ref m);
			Assert.IsFalse (child1.IsHandleCreated, "F11");

			SetUp ();
			child1.PublicProcessKeyPreview (ref m);
			Assert.IsFalse (child1.IsHandleCreated, "F12");

			SetUp ();
			child1.PublicProcessMnemonic ('Z');
			Assert.IsFalse (child1.IsHandleCreated, "F13");

			SetUp ();
			child1.PublicProcessTabKey (true);
			Assert.IsFalse (child1.IsHandleCreated, "F14");

#if !__MonoCS__
			SetUp ();
			child1.Controls.Add (new Control ());
			child1.PublicScrollToControl (child1.Controls [0]);
			Assert.IsFalse (child1.IsHandleCreated, "F15");
#endif

			SetUp ();
			child1.PublicSelect (true, true);
			Assert.IsTrue (child1.IsHandleCreated, "F16");

			SetUp ();
			child1.PublicSetDisplayRectLocation (13, 17);
			Assert.IsFalse (child1.IsHandleCreated, "F17");

			SetUp ();
			child1.PublicSetScrollState (5, false);
			Assert.IsFalse (child1.IsHandleCreated, "F18");

			SetUp ();
			child1.PublicUpdateDefaultButton (3, false);
			Assert.IsFalse (child1.IsHandleCreated, "F19");
		}

		private class ProtectedForm : Form
		{
			// Properties
			public SizeF PublicAutoScaleFactor { get { return base.AutoScaleFactor; } } 
#if !__MonoCS__
			public bool PublicCanRaiseEvents { get { return base.CanRaiseEvents; } }
#endif
			public CreateParams PublicCreateParams { get { return base.CreateParams; } }
			public Cursor PublicDefaultCursor { get { return base.DefaultCursor; } }
			public ImeMode PublicDefaultImeMode { get { return base.DefaultImeMode; } }
			public Padding PublicDefaultMargin { get { return base.DefaultMargin; } }
			public Size PublicDefaultMaximumSize { get { return base.DefaultMaximumSize; } }
			public Size PublicDefaultMinimumSize { get { return base.DefaultMinimumSize; } }
			public Padding PublicDefaultPadding { get { return base.DefaultPadding; } }
			public Size PublicDefaultSize { get { return base.DefaultSize; } }
			public bool PublicDesignMode { get {return base.DesignMode; } }
			public bool PublicDoubleBuffered { get { return base.DoubleBuffered; } set { base.DoubleBuffered = value; } }
			public EventHandlerList PublicEvents { get {return base.Events; } }			
			public int PublicFontHeight { get { return base.FontHeight; } set { base.FontHeight = value; } }
			public bool PublicHScroll { get {return base.HScroll; } set { base.HScroll = value;} }
			public Rectangle PublicMaximizedBounds { get {return base.MaximizedBounds; } set { base.MaximizedBounds = value; }}
			public bool PublicRenderRightToLeft { get { return base.RenderRightToLeft; } }
			public bool PublicResizeRedraw { get { return base.ResizeRedraw; } set { base.ResizeRedraw = value; } }
#if !__MonoCS__
			public bool PublicScaleChildren { get { return base.ScaleChildren; } }
#endif
			public bool PublicShowFocusCues { get { return base.ShowFocusCues; } }
			public bool PublicShowKeyboardCues { get { return base.ShowKeyboardCues; } }
			public bool PublicShowWithoutActivation { get { return base.ShowWithoutActivation; } } 
			public bool PublicVScroll { get { return base.VScroll; } set { base.VScroll = value; } }
			
			
			// Methods
			public void PublicAccessibilityNotifyClients (AccessibleEvents accEvent, int childID) { base.AccessibilityNotifyClients (accEvent, childID); }
			public void PublicActivateMdiChild (Form form) { base.ActivateMdiChild (form); }
			public void PublicAdjustFormScrollbars (bool displayScrollbars) {base.AdjustFormScrollbars (displayScrollbars); }
			public void PublicCenterToParent () { base.CenterToParent (); }
			public void PublicCenterToScreen () { base.CenterToScreen (); }
			public void PublicCreateAccessibilityInstance () { base.CreateAccessibilityInstance (); }
			public void PublicCreateControlsInstance () { base.CreateControlsInstance (); }
			public void PublicCreateHandle () { base.CreateHandle (); }
			public void PublicDestroyHandle () { base.DestroyHandle (); }
			public AccessibleObject PublicGetAccessibilityObjectById (int objectId) { return base.GetAccessibilityObjectById (objectId); }
#if !__MonoCS__
			public AutoSizeMode PublicGetAutoSizeMode () { return base.GetAutoSizeMode (); }
			public Rectangle PublicGetScaledBounds (Rectangle bounds, SizeF factor, BoundsSpecified specified) { return base.GetScaledBounds (bounds, factor, specified); }
#endif
			public bool PublicGetScrollState (int bit) { return base.GetScrollState (bit); }
			public object PublicGetService (Type service) { return base.GetService (service); }
			public bool PublicGetStyle (ControlStyles flag) { return base.GetStyle (flag); }
			public bool PublicGetTopLevel () { return base.GetTopLevel (); }
			public void PublicInitLayout () { base.InitLayout (); }
			public void PublicInvokeGotFocus (Control toInvoke, EventArgs e) { base.InvokeGotFocus (toInvoke, e); }
			public void PublicInvokeLostFocus (Control toInvoke, EventArgs e) { base.InvokeLostFocus (toInvoke, e); }
			public void PublicInvokeOnClick (Control toInvoke, EventArgs e) { base.InvokeOnClick (toInvoke, e); }
			public void PublicInvokePaint (Control c, PaintEventArgs e) { base.InvokePaint (c, e); }
			public void PublicInvokePaintBackground (Control c, PaintEventArgs e) { base.InvokePaintBackground (c, e); }
			public bool PublicIsInputChar (char charCode) { return base.IsInputChar (charCode); }
			public bool PublicIsInputKey (Keys keyData) { return base.IsInputKey (keyData); }
			public void PublicNotifyInvalidate (Rectangle invalidatedArea) { base.NotifyInvalidate (invalidatedArea); }
			public void PublicOnVisibleChanged (EventArgs e) { base.OnVisibleChanged (e); }
			public void PublicProcessCmdKey (ref Message msg, Keys keyData) { base.ProcessCmdKey (ref msg, keyData); }
			public void PublicProcessDialogChar (char charCode) { base.ProcessDialogChar (charCode); }
			public void PublicProcessDialogKey (Keys keyData) { base.ProcessDialogKey (keyData); }
			public void PublicProcessKeyEventArgs (ref Message m) { base.ProcessKeyEventArgs (ref m); }
			public void PublicProcessKeyMessage (ref Message m) { base.ProcessKeyMessage (ref m); }
			public void PublicProcessKeyPreview (ref Message m) { base.ProcessKeyPreview (ref m); }
			public void PublicProcessMnemonic (char charCode) { base.ProcessMnemonic (charCode); }
			public void PublicProcessTabKey (bool forward) { base.ProcessTabKey (forward); }
			public void PublicRaiseDragEvent (Object key, DragEventArgs e) { base.RaiseDragEvent (key, e); }
			public void PublicRaiseKeyEvent (Object key, KeyEventArgs e) { base.RaiseKeyEvent (key, e); }
			public void PublicRaiseMouseEvent (Object key, MouseEventArgs e) { base.RaiseMouseEvent (key, e); }
			public void PublicRaisePaintEvent (Object key, PaintEventArgs e) { base.RaisePaintEvent (key, e); }
			public void PublicRecreateHandle () { base.RecreateHandle (); }
			public void PublicResetMouseEventArgs () { base.ResetMouseEventArgs (); }
			public ContentAlignment PublicRtlTranslateAlignment (ContentAlignment align) { return base.RtlTranslateAlignment (align); }
			public ContentAlignment PublicRtlTranslateContent (ContentAlignment align) { return base.RtlTranslateContent (align); }
			public HorizontalAlignment PublicRtlTranslateHorizontal (HorizontalAlignment align) { return base.RtlTranslateHorizontal (align); }
			public LeftRightAlignment PublicRtlTranslateLeftRight (LeftRightAlignment align) { return base.RtlTranslateLeftRight (align); }
#if !__MonoCS__
			public void PublicScaleControl (SizeF factor, BoundsSpecified specified) { base.ScaleControl (factor, specified); }
#endif
			public void PublicScaleCore (float dx, float dy) { base.ScaleCore (dx, dy); }
#if !__MonoCS__
			public void PublicScrollToControl (Control activeControl) { base.ScrollToControl (activeControl); } 
#endif
			public void PublicSelect () { base.Select (); }
			public void PublicSelect (bool directed, bool forward) { base.Select (directed, forward); }

#if !__MonoCS__
			public void PublicSetAutoSizeMode (AutoSizeMode mode) { base.SetAutoSizeMode (mode); }
#endif
			public void PublicSetBoundsCore (int x, int y, int width, int height, BoundsSpecified specified) { base.SetBoundsCore (x, y, width, height, specified); }
			public void PublicSetClientSizeCore (int x, int y) { base.SetClientSizeCore (x, y); }
			public void PublicSetDisplayRectLocation (int x, int y) { base.SetDisplayRectLocation (x, y); }
			public void PublicSetScrollState (int bit, bool value) { base.SetScrollState (bit, value); }
			public void PublicSetStyle (ControlStyles flag, bool value) { base.SetStyle (flag, value); }
			public void PublicSetTopLevel (bool value) { base.SetTopLevel (value); }
			public void PublicSetVisibleCore (bool value) { base.SetVisibleCore (value); }
			public Size PublicSizeFromClientSize (Size clientSize) { return base.SizeFromClientSize (clientSize); }
			public void PublicUpdateBounds () { base.UpdateBounds (); }
			public void PublicUpdateDefaultButton (int bit, bool value) { base.UpdateDefaultButton (); }
			public void PublicUpdateStyles () { base.UpdateStyles (); }
			public void PublicUpdateZOrder () { base.UpdateZOrder (); }
		}
	}
}