User Tools

Site Tools


simple_input_example

Differences

This shows you the differences between two versions of the page.


simple_input_example [2022/09/03 23:25] (current) – created - external edit 127.0.0.1
Line 1: Line 1:
 +<code>
 +import clr
 +clr.AddReference ('System.Windows.Forms')
 +clr.AddReference('System.Drawing')
 +
 +from System.Drawing import Point
 +from System.Windows.Forms import TextBox, Keys, KeyPressEventHandler
 +
 +from System.Windows import Forms
 +
 +class MyMainForm(Forms.Form):
 +    def __init__(self):
 +        self.Width = 300
 +        self.Height = 200
 +        self.Text = 'Main Form'
 +        my_button = Forms.Button(Text='Go!')
 +        my_button.Click += self.MyOnClick
 +        my_button.Location = Point(25, 95)
 +        self.Controls.Add(my_button)
 +        
 +        self.textbox = TextBox()
 +        self.textbox.Text = "0"
 +        self.textbox.Location = Point(25, 75)
 +        self.textbox.Width = 150
 +        #self.textbox.KeyDown += self.OnEnter
 +        self.textbox.KeyPress += KeyPressEventHandler(self.OnEnter)
 +        self.Controls.Add(self.textbox)
 +        
 +    def MyOnClick(self, *args):
 +        self.Finished()
 +    
 +    def OnEnter(self, e, args):
 +        key = args.KeyChar
 +        if key == Keys.Enter:
 +            self.Finished()
 +            
 +    def Finished(self):
 +        Misc.SendMessage("Answer was: {}".format(self.textbox.Text))
 +        self.Close()
 +
 +app = MyMainForm()
 +Forms.Application.Run(app)
 +</code>
  
simple_input_example.txt · Last modified: 2022/09/03 23:25 by 127.0.0.1

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

Exception: Git command failed to perform periodic pull: From https://github.com/RazorEnhanced/razorenhanced.github.io * branch main -> FETCH_HEAD error

An unforeseen error has occured. This is most likely a bug somewhere. It might be a problem in the gitbacked plugin.

More info has been written to the DokuWiki error log.