반응형
Notice
Recent Posts
Recent Comments
Link
일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | 4 | 5 | 6 | 7 |
8 | 9 | 10 | 11 | 12 | 13 | 14 |
15 | 16 | 17 | 18 | 19 | 20 | 21 |
22 | 23 | 24 | 25 | 26 | 27 | 28 |
29 | 30 |
Tags
- BS
- 정보처리기사
- 정처기
- 비전공자
- 웹앱
- 머신러닝
- APPEND
- Req
- lombok
- 백준
- AWS
- crawling
- springboot
- SOUP
- request
- dataframe
- regressor
- Intellij
- 자바스크립트
- ensemble
- pandas
- java
- 정보처리기사필기
- list
- sklearn
- BeautifulSoup
- javascript
- 자바
- pds
- 크롤링
Archives
- Today
- Total
No sweet without sweat
[C#] - 콤보박스 셋팅 본문
728x90
반응형
using System;
using System.Windows.Forms;
namespace ComboBoxExample
{
public partial class MainForm : Form
{
public MainForm()
{
InitializeComponent();
// 콤보박스에 항목 추가
comboBoxUsage.Items.Add("Yes");
comboBoxUsage.Items.Add("No");
// 기본 선택값 설정
comboBoxUsage.SelectedIndex = 0; // 예를 들어, "Yes"를 기본으로 선택
}
private void buttonSearch_Click(object sender, EventArgs e)
{
// 선택된 항목 가져오기
string selectedValue = comboBoxUsage.SelectedItem.ToString();
// 이제 selectedValue를 사용하여 조회 로직을 수행하면 됩니다.
// 예를 들어, MessageBox로 선택된 값을 표시하는 코드:
MessageBox.Show("조회 조건: " + selectedValue);
}
}
}
728x90
반응형
'C#' 카테고리의 다른 글
[C#] - JSON파싱한 값 가져오는 법 (0) | 2023.11.23 |
---|---|
[C#] - 문자인지 숫자인지 파악하는 법 (1) | 2023.11.18 |
Comments