0

I am using pythonnet for scripting winforms.

class IForm(Form):
    def __init__(self):
        self.excel_file = None
        self.Text = 'Demo'
        self.Size = Size(250, 200)
        self.Icon = Icon(icon)
        self.label = Label()
        self.label.Location = Point(0, 130)
        self.label.Name = "label1"
        self.label.Size = Size(110, 15)
        self.label.TabIndex = 2
        self.label.Text = "© 2016"
        _font = Font("Serif", 7.0)
        self.label.Font = _font
        self.label.ForeColor = Color.Gray
        self.label.Anchor = (AnchorStyles.Bottom | AnchorStyles.Left)
        self.Controls.Add(self.label)
        self.sb = StatusBar()
        self.sb.Parent = self
        self.CenterToScreen()

def workingscript(data_dict):
    guiform = IForm()
    Application.Run(guiform)
    guiform.sb.Text = "Working" #not working
    Application.Close(guiform) #not working

Everything works fine except I don't know how to control the application from withing script after it initialize.

denfromufa
  • 5,610
  • 13
  • 81
  • 138
Rahul
  • 10,830
  • 4
  • 53
  • 88

0 Answers0