I have a windows form application written in C# and it has three tabs and I would like the accept button change with the active tab. Like When I am in tab 1 I want button _1 to be the accept button but when I am in tab 3 I want button_3 to be my accept button. I cannot figure out how to do this and maybe I'm not using the correct terms in my searches but I cannot find any good resources online showing me how to do this.
相关问题
- Sorting 3 numbers without branching [closed]
- Graphics.DrawImage() - Throws out of memory except
- Why am I getting UnauthorizedAccessException on th
- 求获取指定qq 资料的方法
- How to know full paths to DLL's from .csproj f
You can do different things based on the tab that is currently selected by using the following code in the
AcceptButton_Click
event handler:If you prefer to work with strings, each tab page has a unique name:
If this answered your question, please mark it as the answer to your question.
TabControl have SelectedIndexChanged event.
Best guess would be to hook in to the
SelectedIndexChanged
event on the tab control and change theAcceptButton
depending on which tab is selected. Pseudo-code:Or something of the sort.