self.label2 = tk.Label(input_frame, text="點檢時間") self.label2.pack(side=tk.LEFT, padx=0.02, pady=0.02) self.combobox2 = ttk.Combobox(input_frame) self.combobox2.pack(side=tk.LEFT, padx=0.02, pady=0.02) self.update_time() values = ["唐彪", "汾陽", "劉永剛"] self.label3 = tk.Label(input_frame, text="點檢人") self.label3.pack(side=tk.LEFT, padx=0.02, pady=0.02) self.combobox3 = tk.ttk.Combobox(input_frame, values=values) self.combobox3.pack(side=tk.LEFT, padx=0.02, pady=0.02) self.combobox3.current(0) values = ["D", "N"] self.label5 = tk.Label(input_frame, text="班別") self.label5.pack(side=tk.LEFT, padx=0.02, pady=0.02) self.combobox5 = tk.ttk.Combobox(input_frame, values=values) self.combobox5.pack(side=tk.LEFT, padx=0.05, pady=0.05) self.combobox5.current(0) values = [""] self.label6 = tk.Label(input_frame, text="機種") self.label6.pack(side=tk.LEFT, padx=0.05, pady=0.05) self.combobox6 = tk.ttk.Combobox(input_frame, values=values) self.combobox6.pack(side=tk.LEFT, padx=0.05, pady=0.05) self.combobox6.current(0)將下拉輸入框長度小一點
时间: 2023-12-09 11:02:37 浏览: 92
python例程2.折叠控件.7z
您可以使用 `width` 参数来设置下拉输入框的长度,例如:
```
self.combobox2 = ttk.Combobox(input_frame, width=10)
```
这将设置下拉输入框的宽度为 10 个字符。您可以根据需要进行调整。
阅读全文