Click here to Skip to main content
15,891,136 members
Please Sign up or sign in to vote.
2.00/5 (1 vote)
See more:
In my application I have added a tabcontrol. In my first tab i have a few checkbox and when i click on the next button it should show another controls like combo box in same tab . How can i do it WPF .

http://code.msdn.microsoft.com/CSWPFPaging-ce1ce482[^]

I used the above project as a reference but there are using data only i need to navigate page in the s
Posted
Updated 14-Aug-11 9:38am
v2
Comments
Sergey Alexandrovich Kryukov 15-Aug-11 2:02am    
What do you mean by "page"? You say this is not a browser application, so what's the "page"?
--SA
steven8Gerrard 15-Aug-11 4:30am    
Not a browser application but my application should have a web look .
steven8Gerrard 15-Aug-11 10:13am    
I dont necessarily need a page . I need different controls in one tab say tab1 . When i click on next it should show some other controls . Thats what i need . ithink page is what would fit in

If you are looking at browser based applications, then read about the Navigation Overview[^].

If irs just a new tab you want to launch in a tab, you could create a new tab and then display a combo in it.
 
Share this answer
 
Comments
steven8Gerrard 14-Aug-11 4:58am    
Not really browser application . I just wants to move pages in tab since i have different things to do in other tab
Ok, so it seems that you are looking for a Wizard.

The best thing I see is by using Navigation Windows like one I have described in my article.
WPF Tutorial : Layout-Panels-Containers & Layout Transformation[^]

But if you do not like the layout that comes with the Navigation Window, you can actually mimic the same yourself to suit you.

Just play with Visibility. Use a Button to apply Visibility to a set of controls, may be your TabPage, or a StackPanel (anything).

Create all the panels in your XAML or load it using UserControl and Load them when you click on a button. You can use MVVM too.

I hope you can do it yourself.

Let me know.
 
Share this answer
 
Comments
steven8Gerrard 15-Aug-11 10:17am    
I'd explain here . i have tabcontrol in my form which has 4 tab items .
In first tab i have a few checkbox and label .
Below i want a next button which i click on next button it should show different controls in same tab is it possible
Abhishek Sur 15-Aug-11 16:21pm    
Yes of course it is possible. Just create the UI in two panels / grids. When the Next button is clicked, change the Existing Grid with the other one.

Grid1.Visibility = Visibility.Collpsed;
Grid2.Visibility = Visibility.Visible;

Sounds good ?
steven8Gerrard 16-Aug-11 2:21am    
In forms When we send the panel to back the controls in the panel will also go back nad it wont be visible in the above panel . Here in wpf when i send the grid to back the controls are not going even if it does . The control is visible on first grid . Any suggestions??
Abhishek Sur 16-Aug-11 6:29am    
Actually WPF and Winforms works totally differently. In case of WinForms each of the controls you define has its corresponding HWND associated. Hence two controls cannot share the same pixel in Windows application.

In case of WPF, on the other hand, controls are actually drawn over a canvas with the same HWND. Hence even though you send back a control, it still becomes visible depending on the opacity of the control above it. And also the control sent to back might also be functional.

So I would recommend to use Visibilty to Collapse the parent object altogether rather than just sending back and forward.
steven8Gerrard 23-Aug-11 6:29am    
I have to use 15grids since i need 15 pages . Here i created grid1 and added two controls(checkbox and button)) and a Next button and added another grid which had a combo box control . I send grid2 to back order .
to back order . I nitially collapsed the visibility of combox and grid2 .

In the event handler of next button . I wrote

grid1.Visibility = Visibility.Collapsed;
button1.Visibility = Visibility.Collapsed;
checkBox1.Visibility = Visibility.Collapsed;
grid2.Visibility = Visibility.Visible;
comboBox1.Visibility = Visibility.Visible;

Still when i click on next button it shows a empty grid . Combobox is not visible

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900