Tab Control
- Tab Control 은 Tab page 를 포함하고 있다.
선택된 Tab 화면 확인하는 방법
if (tabControl1.SelectedTab == tabControl1.TabPages["tab1"])
{
}
화면 전환, 설정
tabControl1.SelectedTab = tabPage2;
페이지 내부 비활성화
- 텝 메뉴가 비활성화 되는 것이 아닌 내부 컨텐츠가 비활성화 된다.
tabPage1.Enabled = false;
Tab 제거
tabControl1.TabPages.Remove(tabPage1);
Tab change event
private void tabControl1_SelectedIndexChanged(object sender, EventArgs e)
{
// Get the currently selected tab index.
int selectedIndex = tabControl1.SelectedIndex;
// Perform actions based on the selected tab index.
switch (selectedIndex)
{
case 0:
// Code to handle the first tab.
break;
case 1:
// Code to handle the second tab.
break;
// Add cases for other tabs as needed.
}
}
Reference
TabControl Class (System.Windows.Forms)
Manages a related set of tab pages.
learn.microsoft.com
'.NET > Winforms' 카테고리의 다른 글
[WINFORMS][DevExpress] GridControl - GirdView.ColumnFilterChanged 컬럼 필터 이벤트 (0) | 2023.08.21 |
---|---|
[WINFORMS] form 데이터 전송 (0) | 2023.08.18 |
[WINFORMS] Control.ControlCollection 메소드 (0) | 2023.08.16 |
[WINFORMS] MessageBox validation (0) | 2023.08.15 |
[WINFORMS] Text validation (0) | 2023.08.15 |