当前位置:网站首页>Method of setting default items in C # ComboBox control code
Method of setting default items in C # ComboBox control code
2022-07-04 11:50:00 【Zhangshizheng】
describe
- C# It can be developed quickly Windows Form application , Drag controls visually , Plus code matching , It can realize the development of powerful applications , Such as host computer development
- Here I develop a host computer based on serial port , Used ComboBox, How to initialize , Select the specified member item ?
Set before

After setting
cmboxBaudRate.SelectedIndex = 12;
/cmboxDataBit.SelectedIndex = 3;
cmboxStopBit.SelectedIndex = 0;
cmboxParity.SelectedIndex = 0;
cmboxFlowControl.SelectedIndex = 0;
- It's mainly used here ComboBox Properties of :
SelectedIndex, Index from 0 Start , If you choose the second item , Use :
cmboxBaudRate.SelectedIndex = 1; /* The second item */
- Notice the :
cmboxBaudRateyes ComboBox Of the control instanceNameattribute , NoTextattribute


Summary
- ComboBox It is often used in the application of some drop-down options , It is widely used , Using skills requires continuous accumulation
- Code operation C# Control for , Need to use controls
Nameattribute , instead ofTextattribute
边栏推荐
- Review of week 278 of leetcode II
- os. Path built-in module
- C language compilation process
- Force buckle 142 Circular linked list II
- AI should take code agriculture? Deepmind offers a programming version of "Alpha dog" alphacode that surpasses nearly half of programmers!
- Realize cross tenant Vnet connection through azure virtual Wan
- OSI seven layer reference model
- 守护进程Xinted和日志记录Syslogd
- Take advantage of the world's sleeping gap to improve and surpass yourself -- get up early
- How to judge the advantages and disadvantages of low code products in the market?
猜你喜欢
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12](/img/b1/926d9b3d7ce9c5104f3e81974eef07.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 12

Post man JSON script version conversion

Failed to configure a DataSource: ‘url‘ attribute is not specified... Bug solution

20 kinds of hardware engineers must be aware of basic components | the latest update to 8.13

Analysis function in SQL
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18](/img/1a/94ef8be5c06c2d1c52fc8ce7f03ea7.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18

Introduction to Lichuang EDA

Climb Phoenix Mountain on December 19, 2021
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21](/img/73/4050a592fdd99bf06e8fd853b157b6.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 21
![[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22](/img/e0/21367eeaeca10c0a2f2aab3a4fa1fb.jpg)
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
随机推荐
Detailed array expansion analysis --- take you step by step analysis
Replace() function
C language compilation process
In 2022, financial products are not guaranteed?
Entitas learning [3] multi context system
iptables导致Heartbeat脑裂
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 11
Lvs+kept realizes four layers of load and high availability
VPS安装Virtualmin面板
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 8
os. Path built-in module
Iptables cause heartbeat brain fissure
Serialization oriented - pickle library, JSON Library
Decrypt the advantages of low code and unlock efficient application development
How to create a new virtual machine
Usage of with as
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 22
Simple understanding of string
AI should take code agriculture? Deepmind offers a programming version of "Alpha dog" alphacode that surpasses nearly half of programmers!
Possible to restore a backup of SQL Server 2014 on SQL Server 2012?