Adding item to tab control in VS 2008 WPF app -
Add item to tab control in the VS 2008 WPF app
I am a newbie for the WPF I am using VS 2008 and working with WPF app.
I add a tab control with the design editor and then add a new tab. I leave a button on the tab control as a button but in reality, instead of being in separate tabs, the object is roughly at the top of the control.
Am I doing wrong or what is the need to separate?
EDIT: Here is an example of what XAM is created.
& lt; Window x: Class = "testapp.Window1" xmlns = "http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns: X = "http://schemas.microsoft.com/winfx/2006/ Xaml "title =" window 1 "height =" 300 "width =" 300 "& gt; & Lt; Grid & gt; & Lt; Text box height = "23" margin = "87,80,71,0" name = "text box 1" vertical alignment = "top" /> & Lt; TabControl margin = "8,29,1,64" name = "Tab control 1" & gt; & Lt; TabItem / & gt; & Lt; TabItem / & gt; & Lt; TabItem / & gt; & Lt; / TabControl & gt; & Lt; / Grid & gt; & Lt; / Window & gt;
Visual designer may be a bit useless, try to use the mix That's going to be another learning curve, I usually give the code in xaml view to my xaml. So if necessary make adjustments using the Designer Use XML to keep your elements in the right container, use the designer for position / layout. I always find that it puts very ugly margins on those elements they do not need.
Your code should be
& lt; Window x: Class = "TestApp.Window1" xmlns = "http://schemas.microsoft.com/winfx/2006/ Xaml / Presentation" xmlns: x = "http://schemas.microsoft.com/winfx/2006/ Xaml "title =" window 1 "height =" 300 "width =" 300 "& gt; & Lt; Grid & gt; & Lt; TabControl margin = "8,29,1,64" name = "Tab control 1" & gt; & Lt; TabItem & gt; & Lt; Text box height = "23" margin = "87,80,71,0" name = "text box 1" vertical alignment = "top" /> & Lt; / TabItem & gt; & Lt; TabItem / & gt; & Lt; TabItem / & gt; & Lt; / TabControl & gt; & Lt; / Grid & gt; & Lt; / Window & gt;
But you already knew, right? As a control if you do not use columns and rows to appear modally at the top of another, the grid is render at the top of the children, I usually use the item at the top of other items to create 'fake' modal control. I use it to keep
Comments
Post a Comment