Click here to Skip to main content
15,905,229 members
Home / Discussions / WPF
   

WPF

 
GeneralRe: Odd WPF Problem Pin
Jammer19-Oct-08 3:25
Jammer19-Oct-08 3:25 
QuestionWPF ListBoxItem Question Pin
Pedram Behroozi17-Oct-08 10:58
Pedram Behroozi17-Oct-08 10:58 
AnswerRe: WPF ListBoxItem Question Pin
User 27100918-Oct-08 20:19
User 27100918-Oct-08 20:19 
GeneralRe: WPF ListBoxItem Question Pin
Pedram Behroozi19-Oct-08 0:30
Pedram Behroozi19-Oct-08 0:30 
Questionevent notification Pin
vinod.sankuthodi16-Oct-08 23:46
vinod.sankuthodi16-Oct-08 23:46 
AnswerRe: event notification Pin
User 27100918-Oct-08 20:22
User 27100918-Oct-08 20:22 
QuestionUsing Multiple User Controls Pin
jayvee102216-Oct-08 16:14
jayvee102216-Oct-08 16:14 
AnswerRe: Using Multiple User Controls Pin
Pete O'Hanlon16-Oct-08 23:07
mvePete O'Hanlon16-Oct-08 23:07 
The following XAML adds in an empty tabcontrol. The button click event is used to trigger the tab add:
<Window x:Class="SimpleWpfTabTest.Window1"
  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
  Title="Window1" Height="300" Width="300">
  <Grid>
  <Grid.RowDefinitions>
    <RowDefinition Height="Auto"/>
    <RowDefinition Height="20" />
  </Grid.RowDefinitions>
  <TabControl Name="myTab" Grid.Row="0">
  </TabControl>
  <Button Name="btnAddTab" Grid.Row="1" Click="btnAddTab_Click" />
  </Grid>
</Window>
Then the code for the tab add.
private void btnAddTab_Click(object sender, RoutedEventArgs e)
{
  // Create a TabItem
  TabItem child = new TabItem{Name="childTab" + myTab.Items.Count.ToString(), Header="Added"};
  // The TabItem needs a content holder - I'm using a StackPanel
  StackPanel childPanel = new StackPanel();
  child.Content = childPanel;
  // The button will be added as a child of the stack panel.
  Button myButton = new Button { Name = "hello", Content = "Woopee" };
  childPanel.Children.Add(myButton);
  // Add the TabItem to the tab
  myTab.Items.Add(child);
  // And set the focus to it.
  child.Focus();
}


Deja View - the feeling that you've seen this post before.

My blog | My articles | MoXAML PowerToys



GeneralRe: Using Multiple User Controls Pin
Jammer16-Oct-08 23:20
Jammer16-Oct-08 23:20 
GeneralRe: Using Multiple User Controls Pin
Pete O'Hanlon16-Oct-08 23:46
mvePete O'Hanlon16-Oct-08 23:46 
GeneralRe: Using Multiple User Controls Pin
Jammer17-Oct-08 0:43
Jammer17-Oct-08 0:43 
GeneralRe: Using Multiple User Controls Pin
Pete O'Hanlon17-Oct-08 1:09
mvePete O'Hanlon17-Oct-08 1:09 
GeneralRe: Using Multiple User Controls Pin
Jammer17-Oct-08 1:41
Jammer17-Oct-08 1:41 
AnswerRe: Using Multiple User Controls Pin
Jammer16-Oct-08 23:19
Jammer16-Oct-08 23:19 
AnswerRe: Using Multiple User Controls Pin
jayvee102217-Oct-08 8:05
jayvee102217-Oct-08 8:05 
NewsQuicker way to make Silverlight animations! Pin
OTUTO15-Oct-08 21:28
OTUTO15-Oct-08 21:28 
GeneralRe: Quicker way to make Silverlight animations! Pin
Michael Sync18-Oct-08 21:48
Michael Sync18-Oct-08 21:48 
GeneralRe: Quicker way to make Silverlight animations! Pin
User 2710091-May-09 4:50
User 2710091-May-09 4:50 
QuestionListView In WPF Pin
resna.s15-Oct-08 18:03
resna.s15-Oct-08 18:03 
AnswerRe: ListView In WPF Pin
Pete O'Hanlon15-Oct-08 23:46
mvePete O'Hanlon15-Oct-08 23:46 
QuestionXAML Power Toys 3.3 Released With New Class Browser Pin
User 27100914-Oct-08 0:22
User 27100914-Oct-08 0:22 
QuestionDynamically setting textbox/listbox background and isTabStop Pin
John Hanlon13-Oct-08 11:01
John Hanlon13-Oct-08 11:01 
AnswerRe: Dynamically setting textbox/listbox background and isTabStop Pin
User 27100913-Oct-08 14:00
User 27100913-Oct-08 14:00 
QuestionWPF idle application freezes Pin
Camilo Sanchez13-Oct-08 10:19
Camilo Sanchez13-Oct-08 10:19 
AnswerRe: WPF idle application freezes Pin
User 27100914-Oct-08 5:03
User 27100914-Oct-08 5:03 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.