def __init__(self): self.Title="Timer" self.timer1=Timer() self.timer1.Interval=1000 self.timer1.Tick+=self.timer1_tick label1=Label() label1.AutoSize=True label1.Location=Point(41,22) label1.Text="00:00:00" label1.Font=Font("MS UI Gothic",24.0,FontStyle.Regular) self.label1=label1 self.Controls.Add(self.label1) clientwidth=255 b1=Button() b1.Location=Point((clientwidth-b1.Width*2)/3,68) b1.Text="Click" b1.Click+=self.start_Click self.Controls.Add(b1) b2=Button() b2.Location=Point((clientwidth-b1.Width*2)*2/3+b1.Width,68) b2.Text="Stop" b2.Click+=self.stop_Click self.Controls.Add(b2) self.ClientSize=Size(clientwidth,103) self.Text="Stop Watch" self.StartPosition=FormStartPosition.CenterScreen
def __build_advancedtab(self): ''' builds and returns the "Advanced" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormAdvancedTab") # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(14, 25) label.Size = Size(299, 17) label.Text = i18n.get("ConfigFormAdvancedText") # 2. --- build the update checklist (contains all the 'data' checkboxes) tbox = RichTextBox() tbox.Multiline = True tbox.MaxLength = 65536 tbox.WordWrap = True tbox.Location = Point(15, 50) tbox.Size = Size(355, 200) menu = ContextMenu() items = menu.MenuItems items.Add(MenuItem(i18n.get("TextCut"), lambda s, ea: tbox.Cut())) items.Add(MenuItem(i18n.get("TextCopy"), lambda s, ea: tbox.Copy())) items.Add(MenuItem(i18n.get("TextPaste"), lambda s, ea: tbox.Paste())) tbox.ContextMenu = menu self.__advanced_tbox = tbox # 3. --- add 'em all to the tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(self.__advanced_tbox) return tabpage
def __init__(self, plan): # Set the size of the form self.Size = Size(500, 200) # Set title of the form self.Text = 'Approximate fiducial location' # Add a label label = Label() label.Text = 'Type the approximate fiducial location in mm' label.Location = Point(15, 15) label.AutoSize = True self.Controls.Add(label) # Add a TextBox self.textbox = TextBox() self.textbox.Location = Point(15, 60) self.textbox.Width = 150 self.Controls.Add(self.textbox) # Add button to press OK and close the form button = Button() button.Text = 'OK' button.AutoSize = True button.Location = Point(15, 100) button.Click += self.ok_button_clicked self.Controls.Add(button)
def __init__(self): self.Text = "Spreadsheet to HTML" self.Width = 220 self.Height = 90 self.FormBorderStyle = FormBorderStyle.Fixed3D self.openDialog = OpenFileDialog() self.openDialog.Title = "Choose a Python Spreadsheet File" self.openDialog.Filter = 'Python files (*.py)|*.py|All files (*.*)|*.*' self.folderDialog = FolderBrowserDialog() self.folderDialog.ShowNewFolderButton = True self.folderDialog.Description = "Choose a directory to save the HTML files in." l = Label() l.AutoSize = True l.Location = Point(50, 5) l.Text = "Choose a Spreadsheet" b = Button(Text="Choose") b.Click += self.convert b.Location = Point(70, 30) self.Controls.Add(l) self.Controls.Add(b)
def add_heading_label(text, panel): # add heading label label = Label() label.Parent = panel label.Text = text label.AutoSize = True label.Font = HEADER_FONT label.Margin = Padding(0, 5, 0, 5)
def addNameLabel(self, name, imageName, location): label = Label() label.Parent = self label.AutoSize = True label.Location = location label.Text = name label.MouseEnter += lambda *_: self.switchImage(imageName) label.MouseLeave += self.resetImage
def ShowDialog(self, controller, title, text, default_input, exp_index): # set controller self.controller = controller # set exp index self.exp_index = exp_index # initialize exp name variable self.exp_name = None # initialize invalid name label self.invalid_name_label = None # create the form self.dialog_window = Form() self.dialog_window.AutoSize = True self.dialog_window.Width = 400 self.dialog_window.MaximumSize = Size(400, 160) self.dialog_window.StartPosition = FormStartPosition.CenterScreen self.dialog_window.Text = title self.dialog_window.FormBorderStyle = FormBorderStyle.FixedSingle # create the main panel self.panel = FlowLayoutPanel() self.panel.Parent = self.dialog_window self.panel.BackColor = DIALOG_COLOR self.panel.Dock = DockStyle.Top self.panel.Padding = Padding(10, 10, 0, 10) self.panel.FlowDirection = FlowDirection.TopDown self.panel.WrapContents = False self.panel.AutoSize = True self.panel.Font = BODY_FONT # add the dialog text exp_name_label = Label() exp_name_label.Parent = self.panel exp_name_label.Text = text exp_name_label.Width = self.panel.Width exp_name_label.AutoSize = True exp_name_label.Margin = Padding(0, 5, 0, 0) # add the textbox self.exp_name_box = TextBox() self.exp_name_box.Text = default_input self.exp_name_box.Parent = self.panel self.exp_name_box.Width = self.panel.Width - 30 self.exp_name_box.AutoSize = True self.exp_name_box.BackColor = BUTTON_PANEL_COLOR self.exp_name_box.Font = Font(BODY_FONT.FontFamily, 9) # add save button panel self.add_save_button_panel() # show the dialog self.dialog_window.ShowDialog() # return the exp name return self.exp_name
def add_param_label(text, panel): # add param label label = Label() label.Parent = panel label.Text = text label.AutoSize = True label.Font = BODY_FONT label.Margin = Padding(0, 5, 0, 0) label.Width = panel.Width
def __build_label(self): ''' Builds and returns the label for this form. ''' label = Label() label.UseMnemonic = False label.Text = '' # updated everytime we start scraping a new comic label.Location = Point(13, 45) label.Size = Size(320, 15) label.Anchor = AnchorStyles.Top | AnchorStyles.Left |AnchorStyles.Right label.AutoSize = False return label
def __build_label(self): ''' Builds and returns the label for this form. ''' label = Label() label.UseMnemonic = False label.Text = '' # updated everytime we start scraping a new comic label.Location = Point(13, 45) label.Size = Size(320, 15) label.Anchor = AnchorStyles.Top | AnchorStyles.Left | AnchorStyles.Right label.AutoSize = False return label
def __build_comicvinetab(self): ''' builds and returns the "ComicVine" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormComicVineTab") tabpage.Name = "comicvine" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = False label.Location = Point(34, 80) label.Size = Size(315, 54) label.Text = i18n.get("ConfigFormComicVineText") # 2. --- the API key text box fired_update_gui = self.__fired_update_gui class ApiKeyTextBox(TextBox): def OnTextChanged(self, args): fired_update_gui() self.__api_key_tbox = ApiKeyTextBox() tbox = self.__api_key_tbox tbox.Location = Point(34, 135) tbox.Size = Size(315, 1) menu = ContextMenu() items = menu.MenuItems items.Add(MenuItem(i18n.get("TextCut"), lambda s, ea: tbox.Cut())) items.Add(MenuItem(i18n.get("TextCopy"), lambda s, ea: tbox.Copy())) items.Add(MenuItem(i18n.get("TextPaste"), lambda s, ea: tbox.Paste())) tbox.ContextMenu = menu # 3. --- add a clickable link to send the user to ComicVine linklabel = LinkLabel() linklabel.UseMnemonic = False linklabel.AutoSize = False linklabel.Location = Point(34, 170) linklabel.Size = Size(315, 34) linklabel.Text = i18n.get("ConfigFormComicVineClickHere") linklabel.LinkClicked += self.__fired_linkclicked # 4. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(tbox) tabpage.Controls.Add(linklabel) return tabpage
def __build_comicvinetab(self): ''' builds and returns the "ComicVine" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormComicVineTab") tabpage.Name = "comicvine" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = False label.Location = Point(34, 80) label.Size = Size(315, 54) label.Text = i18n.get("ConfigFormComicVineText") # 2. --- the API key text box fired_update_gui = self.__fired_update_gui class ApiKeyTextBox(TextBox): def OnTextChanged(self, args): fired_update_gui() self.__api_key_tbox = ApiKeyTextBox() tbox = self.__api_key_tbox tbox.Location = Point(34, 135) tbox.Size = Size(315, 1) menu = ContextMenu() items = menu.MenuItems items.Add( MenuItem(i18n.get("TextCut"), lambda s, ea : tbox.Cut() ) ) items.Add( MenuItem(i18n.get("TextCopy"), lambda s, ea : tbox.Copy() ) ) items.Add( MenuItem(i18n.get("TextPaste"), lambda s, ea : tbox.Paste() ) ) tbox.ContextMenu = menu # 3. --- add a clickable link to send the user to ComicVine linklabel = LinkLabel() linklabel.UseMnemonic = False linklabel.AutoSize = False linklabel.Location = Point(34, 170) linklabel.Size = Size(315, 34) linklabel.Text = i18n.get("ConfigFormComicVineClickHere") linklabel.LinkClicked += self.__fired_linkclicked # 4. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(tbox) tabpage.Controls.Add(linklabel) return tabpage
def __build_label(self, books): ''' Builds and returns the Label for this form. 'books' -> a list of all the comic books being scraped. ''' plural = len(books) != 1 label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(9, 10) label.Size = Size(319, 13) label.Text = i18n.get("WelcomeFormTextPlural").format(len(books)) \ if plural else i18n.get("WelcomeFormTextSingle") return label
def __init__(self): self.Text = "Hello World" self.FormBorderStyle = FormBorderStyle.Fixed3D self.Height = 150 newFont = Font("Verdana", 16, FontStyle.Bold | FontStyle.Italic) label = Label() label.AutoSize = True label.Text = "My Hello World Label" label.Location = Point(10, 50) label.BackColor = Color.Aquamarine label.ForeColor = Color.DarkMagenta label.Font = newFont self.Controls.Add(label)
def __init__(self, imagePath): Form.__init__(self) self.Width = 346 self.Height = 215 self.images = dict((name, loadImage(imagePath, name + '.jpg')) for name in ('pycon', 'andrzej', 'michael', 'christian')) self.pictureBox = PictureBox() self.pictureBox.Parent = self self.pictureBox.Location = Point(234, 12) self.pictureBox.TabStop = False self.switchImage("pycon") self.mainText = Label() self.mainText.Parent = self self.mainText.AutoSize = True self.mainText.Location = Point(12, 12); self.mainText.Text = ("Tabbed Image Viewer\r\n\r\nWritten for PyCon 2007\r\n" "Using IronPython and Windows Forms\r\n\r\nBy:") self.addNameLabel("Andrzej Krzywda", "andrzej", Point(36, 90)) self.addNameLabel("Christian Muirhead", "christian", Point(36, 105)) self.addNameLabel("Michael Foord", "michael", Point(36, 120)) versionLabel = Label() versionLabel.Parent = self versionLabel.AutoSize = True versionLabel.Location = Point(12, 151) versionLabel.Text = "Version: " + __revision__ self.okButton = Button() self.okButton.Parent = self self.okButton.Text = "OK" self.okButton.Location = Point(251, 146) self.okButton.Click += self.onOK self.AcceptButton = self.okButton self.Text = "About" self.FormBorderStyle = FormBorderStyle.FixedDialog self.MinimizeBox = False self.MaximizeBox = False
def ShowDialog(self, controller, title, text): # set controller self.controller = controller # create confirmation boolean -- True means the user wants to save # the stimulus settings and stop the currently running stimulation. self.confirmation = False # create the form self.dialog_window = Form() self.dialog_window.AutoSize = True self.dialog_window.Width = 400 self.dialog_window.MaximumSize = Size(400, 225) self.dialog_window.StartPosition = FormStartPosition.CenterScreen self.dialog_window.Text = title self.dialog_window.FormBorderStyle = FormBorderStyle.FixedSingle # create the main panel self.panel = FlowLayoutPanel() self.panel.Parent = self.dialog_window self.panel.BackColor = DIALOG_COLOR self.panel.Dock = DockStyle.Top self.panel.Padding = Padding(10, 10, 0, 10) self.panel.FlowDirection = FlowDirection.TopDown self.panel.WrapContents = False self.panel.AutoSize = True self.panel.Font = BODY_FONT # add the dialog text dialog_label = Label() dialog_label.Parent = self.panel dialog_label.Text = text dialog_label.Width = self.panel.Width dialog_label.AutoSize = True dialog_label.Margin = Padding(0, 5, 0, 0) # add button panel self.add_button_panel() # show the dialog self.dialog_window.ShowDialog() # return the exp name return self.confirmation
def populate_stim_choice_panel(self): # empty stim choice panel list_of_controls = self.stim_choice_panel.Controls for control in list_of_controls: control.Dispose() self.stim_choice_panel.Controls.Clear() # add stim choice label stim_choice_label = Label() stim_choice_label.Parent = self.stim_choice_panel stim_choice_label.Text = "Stim:" stim_choice_label.AutoSize = True # add stim chooser self.stim_chooser = ComboBox() self.stim_chooser.DropDownStyle = ComboBoxStyle.DropDownList self.stim_chooser.Parent = self.stim_choice_panel self.stim_chooser.Items.AddRange(("Looming Dot", "Moving Dot", "Combined Dots", "Optomotor Grating", "Grating", "Broadband Grating", "Delay", "Black Flash", "White Flash")) ##!! need to add option for OKR here self.stim_chooser.SelectionChangeCommitted += self.on_stim_choice self.stim_chooser.Text = self.stim_type self.stim_chooser.Width = self.dialog_window.Width - 40 self.stim_chooser.AutoSize = True self.stim_chooser.Font = BODY_FONT
def __build_advancedtab(self): ''' builds and returns the "Advanced" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormAdvancedTab") # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(14, 25) label.Size = Size(299, 17) label.Text = i18n.get("ConfigFormAdvancedText") # 2. --- build the update checklist (contains all the 'data' checkboxes) tbox = RichTextBox() tbox.Multiline=True tbox.MaxLength=65536 tbox.WordWrap = True tbox.Location = Point(15, 50) tbox.Size = Size(355, 200) menu = ContextMenu() items = menu.MenuItems items.Add( MenuItem(i18n.get("TextCut"), lambda s, ea : tbox.Cut() ) ) items.Add( MenuItem(i18n.get("TextCopy"), lambda s, ea : tbox.Copy() ) ) items.Add( MenuItem(i18n.get("TextPaste"), lambda s, ea : tbox.Paste() ) ) tbox.ContextMenu = menu self.__advanced_tbox = tbox # 3. --- add 'em all to the tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(self.__advanced_tbox) return tabpage
import clr clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') from System.Windows.Forms import ( Application, Form, FormBorderStyle, Label ) from System.Drawing import ( Color, Font, FontStyle, Point ) form = Form() form.Text = "Hello World" form.FormBorderStyle = FormBorderStyle.Fixed3D form.Height = 150 newFont = Font("Verdana", 16, FontStyle.Bold | FontStyle.Italic) label = Label() label.AutoSize = True label.Text = "My Hello World Label" label.Font = newFont label.BackColor = Color.Aquamarine label.ForeColor = Color.DarkMagenta label.Location = Point(10, 50) form.Controls.Add(label) Application.Run(form)
def __build_detailstab(self): ''' builds and returns the "Details" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormDetailsTab") tabpage.Name = "details" # 1. --- a description label for this tabpage label = Label() label.UseMnemonic = False label.AutoSize = True label.Location = Point(14, 35) label.Size = Size(299, 17) label.Text = i18n.get("ConfigFormDetailsText") # 2. --- the 'select all' button checkall_button = Button() checkall_button.Click += self.__fired_checkall checkall_button.Location = Point(280, 107) checkall_button.Size = Size(100, 23) checkall_button.Text = i18n.get("ConfigFormDetailsAll") # 3. --- the 'deselect all' button uncheckall_button = Button() uncheckall_button.Click += self.__fired_uncheckall uncheckall_button.Location = Point(280, 138) uncheckall_button.Size = Size(100, 23) uncheckall_button.Text = i18n.get("ConfigFormDetailsNone") # 4. --- build the update checklist (contains all the 'data' checkboxes) self.__update_checklist = CheckedListBox() self.__update_checklist.CheckOnClick = True self.__update_checklist.ColumnWidth = 125 self.__update_checklist.ThreeDCheckBoxes = True self.__update_checklist.Location = Point(15, 65) self.__update_checklist.MultiColumn = True self.__update_checklist.SelectionMode = SelectionMode.One self.__update_checklist.Size = Size(260, 170) self.__update_checklist.ItemCheck += self.__fired_update_gui self.__update_checklist.Items.Add(ConfigForm.__SERIES_CB) self.__update_checklist.Items.Add(ConfigForm.__VOLUME_CB) self.__update_checklist.Items.Add(ConfigForm.__NUMBER_CB) self.__update_checklist.Items.Add(ConfigForm.__TITLE_CB) self.__update_checklist.Items.Add(ConfigForm.__PUBLISHED_CB) self.__update_checklist.Items.Add(ConfigForm.__RELEASED_CB) self.__update_checklist.Items.Add(ConfigForm.__CROSSOVERS_CB) self.__update_checklist.Items.Add(ConfigForm.__PUBLISHER_CB) self.__update_checklist.Items.Add(ConfigForm.__IMPRINT_CB) self.__update_checklist.Items.Add(ConfigForm.__WRITER_CB) self.__update_checklist.Items.Add(ConfigForm.__PENCILLER_CB) self.__update_checklist.Items.Add(ConfigForm.__INKER_CB) self.__update_checklist.Items.Add(ConfigForm.__COLORIST_CB) self.__update_checklist.Items.Add(ConfigForm.__LETTERER_CB) self.__update_checklist.Items.Add(ConfigForm.__COVER_ARTIST_CB) self.__update_checklist.Items.Add(ConfigForm.__EDITOR_CB) self.__update_checklist.Items.Add(ConfigForm.__SUMMARY_CB) self.__update_checklist.Items.Add(ConfigForm.__CHARACTERS_CB) self.__update_checklist.Items.Add(ConfigForm.__TEAMS_CB) self.__update_checklist.Items.Add(ConfigForm.__LOCATIONS_CB) self.__update_checklist.Items.Add(ConfigForm.__WEBPAGE_CB) # 5. --- add 'em all to this tabpage tabpage.Controls.Add(label) tabpage.Controls.Add(checkall_button) tabpage.Controls.Add(uncheckall_button) tabpage.Controls.Add(self.__update_checklist) return tabpage
def __build_behaviourtab(self): ''' builds and returns the "Behaviour" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormBehaviourTab") # 1. --- build the 'When scraping for the first time' label first_scrape_label = Label() first_scrape_label.AutoSize = False first_scrape_label.FlatStyle = FlatStyle.System first_scrape_label.Location = Point(52, 27) first_scrape_label.Text = i18n.get("ConfigFormFirstScrapeLabel") first_scrape_label.Size = Size(300, 17) # 1. --- build the 'autochoose series' checkbox self.__autochoose_series_cb = CheckBox() self.__autochoose_series_cb.AutoSize = False self.__autochoose_series_cb.FlatStyle = FlatStyle.System self.__autochoose_series_cb.Location = Point(82, 45) self.__autochoose_series_cb.Size = Size(300, 34) self.__autochoose_series_cb.Text = i18n.get( "ConfigFormAutochooseSeriesCB") self.__autochoose_series_cb.CheckedChanged += self.__fired_update_gui # 2. --- build the 'confirm issue' checkbox self.__confirm_issue_cb = CheckBox() self.__confirm_issue_cb.AutoSize = False self.__confirm_issue_cb.FlatStyle = FlatStyle.System self.__confirm_issue_cb.Location = Point(82, 75) self.__confirm_issue_cb.Size = Size(300, 34) self.__confirm_issue_cb.Text = i18n.get("ConfigFormConfirmIssueCB") self.__confirm_issue_cb.CheckedChanged += self.__fired_update_gui # 3. -- build the 'use fast rescrape' checkbox self.__fast_rescrape_cb = CheckBox() self.__fast_rescrape_cb.AutoSize = False self.__fast_rescrape_cb.FlatStyle = FlatStyle.System self.__fast_rescrape_cb.Location = Point(52, 116) self.__fast_rescrape_cb.Size = Size(300, 34) self.__fast_rescrape_cb.Text = i18n.get("ConfigFormRescrapeCB") self.__fast_rescrape_cb.CheckedChanged += self.__fired_update_gui # 4. -- build the 'add rescrape hints to notes' checkbox self.__rescrape_notes_cb = CheckBox() self.__rescrape_notes_cb.AutoSize = False self.__rescrape_notes_cb.FlatStyle = FlatStyle.System self.__rescrape_notes_cb.Location = Point(82, 151) self.__rescrape_notes_cb.Size = Size(270, 17) self.__rescrape_notes_cb.Text = i18n.get("ConfigFormRescrapeNotesCB") self.__rescrape_notes_cb.CheckedChanged += self.__fired_update_gui # 5. -- build the 'add rescrape hints to tags' checkbox self.__rescrape_tags_cb = CheckBox() self.__rescrape_tags_cb.AutoSize = False self.__rescrape_tags_cb.FlatStyle = FlatStyle.System self.__rescrape_tags_cb.Location = Point(82, 181) self.__rescrape_tags_cb.Size = Size(270, 17) self.__rescrape_tags_cb.Text = i18n.get("ConfigFormRescrapeTagsCB") self.__rescrape_tags_cb.CheckedChanged += self.__fired_update_gui # 6. --- build the 'specify series name' checkbox self.__summary_dialog_cb = CheckBox() self.__summary_dialog_cb.AutoSize = False self.__summary_dialog_cb.FlatStyle = FlatStyle.System self.__summary_dialog_cb.Location = Point(52, 214) self.__summary_dialog_cb.Size = Size(300, 34) self.__summary_dialog_cb.Text = i18n.get("ConfigFormShowSummaryCB") self.__summary_dialog_cb.CheckedChanged += self.__fired_update_gui # 7. --- add 'em all to the tabpage tabpage.Controls.Add(first_scrape_label) tabpage.Controls.Add(self.__autochoose_series_cb) tabpage.Controls.Add(self.__confirm_issue_cb) tabpage.Controls.Add(self.__fast_rescrape_cb) tabpage.Controls.Add(self.__rescrape_tags_cb) tabpage.Controls.Add(self.__rescrape_notes_cb) tabpage.Controls.Add(self.__summary_dialog_cb) return tabpage
def __build_behaviourtab(self): ''' builds and returns the "Behaviour" Tab for the TabControl ''' tabpage = TabPage() tabpage.Text = i18n.get("ConfigFormBehaviourTab") # 1. --- build the 'When scraping for the first time' label first_scrape_label = Label() first_scrape_label.AutoSize = False first_scrape_label.FlatStyle = FlatStyle.System first_scrape_label.Location = Point(52, 27) first_scrape_label.Text = i18n.get("ConfigFormFirstScrapeLabel") first_scrape_label.Size = Size(300, 17) # 1. --- build the 'autochoose series' checkbox self.__autochoose_series_cb = CheckBox() self.__autochoose_series_cb.AutoSize = False self.__autochoose_series_cb.FlatStyle = FlatStyle.System self.__autochoose_series_cb.Location = Point(82, 45) self.__autochoose_series_cb.Size = Size(300, 34) self.__autochoose_series_cb.Text =i18n.get("ConfigFormAutochooseSeriesCB") self.__autochoose_series_cb.CheckedChanged += self.__fired_update_gui # 2. --- build the 'confirm issue' checkbox self.__confirm_issue_cb = CheckBox() self.__confirm_issue_cb.AutoSize = False self.__confirm_issue_cb.FlatStyle = FlatStyle.System self.__confirm_issue_cb.Location = Point(82, 75) self.__confirm_issue_cb.Size = Size(300, 34) self.__confirm_issue_cb.Text = i18n.get("ConfigFormConfirmIssueCB") self.__confirm_issue_cb.CheckedChanged += self.__fired_update_gui # 3. -- build the 'use fast rescrape' checkbox self.__fast_rescrape_cb = CheckBox() self.__fast_rescrape_cb.AutoSize = False self.__fast_rescrape_cb.FlatStyle = FlatStyle.System self.__fast_rescrape_cb.Location = Point(52, 116) self.__fast_rescrape_cb.Size = Size(300, 34) self.__fast_rescrape_cb.Text = i18n.get("ConfigFormRescrapeCB") self.__fast_rescrape_cb.CheckedChanged += self.__fired_update_gui # 4. -- build the 'add rescrape hints to notes' checkbox self.__rescrape_notes_cb = CheckBox() self.__rescrape_notes_cb.AutoSize = False self.__rescrape_notes_cb.FlatStyle = FlatStyle.System self.__rescrape_notes_cb.Location = Point(82, 151) self.__rescrape_notes_cb.Size = Size(270, 17) self.__rescrape_notes_cb.Text = i18n.get("ConfigFormRescrapeNotesCB") self.__rescrape_notes_cb.CheckedChanged += self.__fired_update_gui # 5. -- build the 'add rescrape hints to tags' checkbox self.__rescrape_tags_cb = CheckBox() self.__rescrape_tags_cb.AutoSize = False self.__rescrape_tags_cb.FlatStyle = FlatStyle.System self.__rescrape_tags_cb.Location = Point(82, 181) self.__rescrape_tags_cb.Size = Size(270, 17) self.__rescrape_tags_cb.Text = i18n.get("ConfigFormRescrapeTagsCB") self.__rescrape_tags_cb.CheckedChanged += self.__fired_update_gui # 6. --- build the 'specify series name' checkbox self.__summary_dialog_cb = CheckBox() self.__summary_dialog_cb.AutoSize = False self.__summary_dialog_cb.FlatStyle = FlatStyle.System self.__summary_dialog_cb.Location = Point(52, 214) self.__summary_dialog_cb.Size = Size(300, 34) self.__summary_dialog_cb.Text = i18n.get("ConfigFormShowSummaryCB") self.__summary_dialog_cb.CheckedChanged += self.__fired_update_gui # 7. --- add 'em all to the tabpage tabpage.Controls.Add(first_scrape_label) tabpage.Controls.Add(self.__autochoose_series_cb) tabpage.Controls.Add(self.__confirm_issue_cb) tabpage.Controls.Add(self.__fast_rescrape_cb) tabpage.Controls.Add(self.__rescrape_tags_cb) tabpage.Controls.Add(self.__rescrape_notes_cb) tabpage.Controls.Add(self.__summary_dialog_cb) return tabpage
import clr clr.AddReference('System.Windows.Forms') clr.AddReference('System.Drawing') from System.Windows.Forms import (Application, Form, FormBorderStyle, Label) from System.Drawing import (Color, Font, FontStyle, Point) form = Form() form.Text = "Hello World" form.FormBorderStyle = FormBorderStyle.Fixed3D form.Height = 150 newFont = Font("Verdana", 16, FontStyle.Bold | FontStyle.Italic) label = Label() label.AutoSize = True label.Text = "My Hello World Label" label.Location = Point(10, 50) label.BackColor = Color.Aquamarine label.ForeColor = Color.DarkMagenta label.Font = newFont form.Controls.Add(label) Application.Run(form)