4
4
import clr
5
5
6
6
import System
7
+ clr .AddReference ("System.Windows.Forms" )
7
8
import System .Windows .Forms as WinForms
8
9
9
10
from System .Drawing import Color , Size , Point
@@ -14,6 +15,7 @@ class Splitter(WinForms.Form):
14
15
'Creating a Multipane User Interface with Windows Forms'."""
15
16
16
17
def __init__ (self ):
18
+ super ().__init__ ()
17
19
18
20
# Create an instance of each control being used.
19
21
self .components = System .ComponentModel .Container ()
@@ -26,13 +28,13 @@ def __init__(self):
26
28
27
29
# Set properties of TreeView control.
28
30
self .treeView1 .Dock = WinForms .DockStyle .Left
29
- self .treeView1 .Width = self .ClientSize .Width / 3
31
+ self .treeView1 .Width = self .ClientSize .Width // 3
30
32
self .treeView1 .TabIndex = 0
31
33
self .treeView1 .Nodes .Add ("TreeView" )
32
34
33
35
# Set properties of ListView control.
34
36
self .listView1 .Dock = WinForms .DockStyle .Top
35
- self .listView1 .Height = self .ClientSize .Height * 2 / 3
37
+ self .listView1 .Height = self .ClientSize .Height * 2 // 3
36
38
self .listView1 .TabIndex = 0
37
39
self .listView1 .Items .Add ("ListView" )
38
40
@@ -52,7 +54,7 @@ def __init__(self):
52
54
self .splitter2 .TabIndex = 1
53
55
54
56
# Set TabStop to false for ease of use when negotiating UI.
55
- self .splitter2 .TabStop = 0
57
+ self .splitter2 .TabStop = False
56
58
57
59
# Set properties of Form's Splitter control.
58
60
self .splitter1 .Location = System .Drawing .Point (121 , 0 )
@@ -61,7 +63,7 @@ def __init__(self):
61
63
self .splitter1 .TabIndex = 1
62
64
63
65
# Set TabStop to false for ease of use when negotiating UI.
64
- self .splitter1 .TabStop = 0
66
+ self .splitter1 .TabStop = False
65
67
66
68
# Add the appropriate controls to the Panel.
67
69
for item in (self .richTextBox1 , self .splitter2 , self .listView1 ):
0 commit comments