当前位置:网站首页>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 :
cmboxBaudRate
yes ComboBox Of the control instanceName
attribute , NoText
attribute
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
Name
attribute , instead ofText
attribute
边栏推荐
- No response after heartbeat startup
- (August 9, 2021) example exercise of air quality index calculation (I)
- Swagger and OpenAPI
- Configure SSH certificate login
- TCP slicing and PSH understanding
- Properties and methods of OS Library
- Automatic translation between Chinese and English
- Recommend a cool geospatial data visualization tool with low code
- [Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 16
- How to judge the advantages and disadvantages of low code products in the market?
猜你喜欢
Force buckle 142 Circular linked list II
DDS-YYDS
Automatic translation between Chinese and English
(August 10, 2021) web crawler learning - Chinese University ranking directed crawler
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
Fundamentals of software testing
Entitas learning [3] multi context system
TCP slicing and PSH understanding
Practical dry goods: deploy mini version message queue based on redis6.0
20 kinds of hardware engineers must be aware of basic components | the latest update to 8.13
随机推荐
OSI seven layer model & unit
Reptile learning 3 (winter vacation learning)
Heartbeat报错 attempted replay attack
Understanding of object
thread
How to judge the advantages and disadvantages of low code products in the market?
SSH principle and public key authentication
QQ set group information
JD home programmers delete databases and run away. Talk about binlog, the killer of MySQL data backup
Dos and path
Customized version of cacti host template
Iframe to only show a certain part of the page
试题库管理系统–数据库设计[通俗易懂]
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 17
Some tips on learning database
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 18
[Yunju entrepreneurial foundation notes] Chapter II entrepreneur test 20
Serialization oriented - pickle library, JSON Library
Swagger and OpenAPI
2018 meisai modeling summary +latex standard meisai template sharing