def __init__(self): self.Text = 'Drag & Drop' self.AllowDrop = True button = Button() button.Parent = self textBox = TextBox() textBox.Parent = self button.AllowDrop = True button.Location = Point(150, 50) button.DragDrop += self.OnDragDrop button.DragEnter += self.OnDragEnter textBox.Location = Point(15, 50) textBox.MouseDown += self.OnMousDown self.ClientSize = Size(250, 200) self.CenterToScreen()