ComboBox class

Hi all, anybody know how can create combobox using combobox class

image

I Hope This Helps You


#Load the Python Standard and DesignScript Libraries
import sys
import clr

clr.AddReference('ProtoGeometry')
#import windows form 
clr.AddReference("System.Windows.Forms")
#import system drawing 
clr.AddReference("System.Drawing")


from System.Windows.Forms import *
from System.Drawing import *

#Place your code below this line
class CreateWindow(Form):
    def __init__(self): 
    	
        # Create the Form
        self.Name = "MyForm"
        self.Text = "MyForm"
        self.Size = Size(467, 650)        
        self.CenterToScreen()

        #Create ComboBox to select levels
        self.cb = ComboBox()
        self.cb.Location = Point(30,20)
        self.cb.Size = Size(200,100)
        self.cb.DropDownHeight = 50
        self.cb.Items.Add(item)
        self.cb.Parent = self

        # Create Okay Button
        btnOk = Button()
        btnOk.Parent = self
        btnOk.Text = "Ok"
        btnOk.Location = Point(10,565)
        btnOk.Font = Font("Helvetica",12)
        btnOk.Size = Size(75,35)
        
        # Register event
        btnOk.Click += self.ButtonClicked
        
    # Create button event
    def ButtonClicked(self, sender, args):
        if sender.Click:
            self.values.append(self.textboxSheetName.Text)
            self.values.append(self.textboxSheetNumber.Text)
            self.Close()


form = CreateWindow()
Application.Run(form)
#### Assign your output to the OUT variable.
OUT = levels

The Revit UI Combobox class is one of the classes allowing customization of the Revit ribbon (no relation with Winform)

3 Likes