How do I clear a combobox?

前端 未结 16 1826
醉梦人生
醉梦人生 2020-12-04 18:55

I have some combo-boxes that are set up as drop down lists, and the user can pick a number in them. I also have a Clear button that should clear the text from the combo boxe

16条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-04 19:32

    Use:

    comboBox1.ResetText();
    

    and it's done.

    Docs: ComboBox.ResetText Method (Namespace: System.Windows.Forms) https://docs.microsoft.com/en-us/dotnet/api/system.windows.forms.combobox.resettext?view=netframework-4.8

提交回复
热议问题