In Flex there is the ViewStack component. Does C# have a similar control?
If so, which? If not, how do you create similar behavior?
相关问题
- 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
No, there is no standard control that provides the same behaviour.
However to get similar behaviour I would simply create a new UserControl for each item in the view stack and add these to a parent form at the same location and with the same width/height.
Using a helper method it is then simple to hide all user controls, and then display the specific user control based on an input parameter.
The major benefit of UserControls is that you can use the designer to visually create each of the separate stack items. A possible drawback is that if you have many items in the stack, or each stack item is complex, memory usage may become quite large.
Yes, the TabControl component works this way. All you have to do is hide the tabs. Add a new class to your project and paste the code shown below. Compile. Drop the new control from the top of the toolbox onto your form. The tabs are still visible at design time, makes it easy to edit the pages. But hidden at runtime. Use the SelectedTab or SelectedIndex property to select the view.
I don't think it exists natively. You will probably have to play with the Visible property.