• 2024-06-12comboBox 下拉框的基础使用
    privatevoidFrmAddStudent_Load(objectsender,EventArgse){StudentClassServerstudentClassServer=newStudentClassServer();List<StudentClass>students=studentClassServer.GetStudentClasses();//获取下拉框的数据//向集合第一个位置插入
  • 2024-03-22C# 01 画面跳转、消息框
    一、2个画面互相跳转form1:privatevoidlabel1_Click(objectsender,EventArgse){//次画面を非表示隐藏此画面显示2画面this.Visible=false;Form2f2=newForm2();f2.Show();}form2:privatevoidbutton2_Cli
  • 2024-02-23(17)Lazarus学习之StringGrid1
    01]下拉ComboBox1选择  参考:C:\lazarus\examples\gridexamples\gridcelleditorprocedureTForm1.StringGrid1SelectEditor(Sender:TObject;aCol,aRow:Integer;varEditor:TWinControl);beginif(aCol=3)and(aRow>0)thenbegin//哪些单元格显示Comb
  • 2024-01-30c# ComboBox控件的常用一些属性和用法、事件及数据绑定方法
    一、常用属性和用法1、Text:获取或设置与此控件关联的文本。//设置默认值this.comboBox1.Text="请选择内容";//orcomboBox1.Items.Add("请选择内容");comboBox1.SelectedIndex=0;2、SelectedIndex:获取或设置指定当前选定项的索引。(设置新索引会SelectedIndexChanged
  • 2024-01-29C# ComboBox、TextBox取到改变前的值
    /*存储改变前的值*/privatestringComboBox1_Beforevalue=String.Empty;privatestringTextBox1_Beforevalue=String.Empty;/*ComboBox1*/this.ComboBox1.SelectedIndexChanged+=newEventHandler(this.ComboBox1_SelectedIndexChanged);this.ComboBox1.DropDown+=
  • 2023-12-11今日报告
    自己设计并编写一个Windows应用程序,要求用到TextBox、GroupBox、RadioButton、CheckBox、ComboBox、ListBox控件。编写了一个最为简单的信息录入的应用程序。  相关代码:privatestringGetSelectedCourses(){List<string>selectedCourses=
  • 2023-11-06C#学习之ListBox,ComboBox,CheckListBox
    ListBox(文本列表)常用属性:Items:描述:ListBox中的项列表。默认值:空用法:可以使用Add(),AddRange(),Insert(),Remove(),Clear(),等方法来对Items集合进行管理。SelectedIndex:描述:ListBox中当前选择项的索引。默认值:-1(表示没有选中项)用法:通过设置或读取该属
  • 2023-10-09C# Winform ComboBox使用笔记
    ComboBox添加元素//添加元素到ComboBoxcomboBox1.Items.Add("元素1");comboBox1.Items.Add("元素2");comboBox1.Items.Add("元素3");for(inti=4;i<6;i++){comboBox1.Items.Add($"元素{i}");}//设置默认显示的项comboBox1.Selecte