2 using System
.Windows
.Forms
;
5 namespace MonoTests
.System
.Windows
.Forms
8 public class SplitterTest
11 /* make sure the Capture setting has nothing to do with SplitPosition (reopened bug #78871) */
13 public void TestCaptureWhileSettingSplitPosition ()
17 TextBox TextBox1
= new TextBox();
18 TextBox1
.Dock
= DockStyle
.Left
;
19 Splitter Splitter
= new Splitter();
20 Splitter
.Dock
= DockStyle
.Left
;
21 TextBox TextBox2
= new TextBox();
22 TextBox2
.Dock
= DockStyle
.Fill
;
23 f
.Controls
.AddRange(new Control
[] { TextBox2, Splitter, TextBox1 }
);
24 Splitter
.Capture
= true;
25 Splitter
.SplitPosition
= (f
.ClientSize
.Width
- Splitter
.Width
) / 2;
27 int position_with_capture
= Splitter
.SplitPosition
;
33 TextBox1
= new TextBox();
34 TextBox1
.Dock
= DockStyle
.Left
;
35 Splitter
= new Splitter();
36 Splitter
.Dock
= DockStyle
.Left
;
37 TextBox2
= new TextBox();
38 TextBox2
.Dock
= DockStyle
.Fill
;
39 f
.Controls
.AddRange(new Control
[] { TextBox2, Splitter, TextBox1 }
);
40 Splitter
.Capture
= true;
41 Splitter
.SplitPosition
= (f
.ClientSize
.Width
- Splitter
.Width
) / 2;
43 Assert
.AreEqual (Splitter
.SplitPosition
, position_with_capture
, "1");