I need help with my WPF application. In the bottom of my window I have a canvas which is filled dynamically with groupboxes, which contain several userlements like buttons and gridviews.
The inserted content is outside my window and I want to access it with scrollbars but the scrollbars aren't adjusting so I can't access the elements.
How can I reach the content with the scrollbars?
Thanks for your help.
<ScrollViewer HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Visible" >
<Grid Height="Auto">
<GroupBox Header="Fleet Import" HorizontalAlignment="Left" Height="115" Margin="23,21,0,0" VerticalAlignment="Top" Width="419">
<StackPanel Margin="0,0,-67,0">
<StackPanel Orientation="Horizontal">
<Button x:Name="btnSelectProject" Content="Select Project" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="88" Height="23" Click="btnSelectProject_Click"/>
<TextBox Name="tbPath" Height="17" Width="283" Margin="10,10,0,0" />
</StackPanel>
<Button x:Name="bntConnectTia" Content="Connect to TIA" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="88" Height="23" Click="bntConnectTia_Click"/>
</StackPanel>
</GroupBox>
<GroupBox Header="Start update" HorizontalAlignment="Left" Height="115" Margin="498,21,0,0" VerticalAlignment="Top" Width="277">
<StackPanel Orientation="Horizontal">
<StackPanel>
<RadioButton Content="Maintanace" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="88" Height="23"/>
<RadioButton Content="Production" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="88" Height="23"/>
</StackPanel>
<StackPanel>
<Button Content="Start Update" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="88" Height="23" Click="Button_Click_2"/>
<Button Content="Cancel" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="88" Height="23"/>
</StackPanel>
</StackPanel>
</GroupBox>
<GroupBox Header="GroupBox" HorizontalAlignment="Left" Height="164" Margin="23,157,0,0" VerticalAlignment="Top" Width="752">
<TextBox HorizontalAlignment="Left" Height="128" TextWrapping="Wrap" Name="tbOutput" VerticalAlignment="Top" Width="742" Margin="0,0,-2,0"/>
</GroupBox>
<Canvas x:Name="canvasDevices" Margin="23,346,25,10" Height="Auto" />
<GroupBox Header="GroupBox" HorizontalAlignment="Left" Height="164" Margin="-393,337,0,-439" VerticalAlignment="Top" Width="752" Visibility="Hidden">
<StackPanel>
<StackPanel Orientation="Horizontal">
<Button Content="Button" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="75"/>
<TextBox HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Width="120"/>
<Button Content="Button" HorizontalAlignment="Left" Margin="10,10,0,0" VerticalAlignment="Top" Width="75"/>
</StackPanel>
<DataGrid Margin="20,10,20,0" RenderTransformOrigin="0.163,0.543" Height="88"/>
</StackPanel>
</GroupBox>
<Button Content="Button" HorizontalAlignment="Left" Margin="89,151,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_3"/>
</Grid>
</ScrollViewer>
GroupBox groupbox = new GroupBox();
groupbox.Header = deviceName;
groupbox.Name = deviceName;
groupbox.Width = 742;
groupbox.Height = 250;
stackPanelV.Children.Add(stackPanelH);
stackPanelV.Children.Add(dgDevice);
groupbox.Content = stackPanelV;
Canvas.SetTop(groupbox,0);
canvasDevices.Children.Add(groupbox);
Your items get out the canvas bounds, canvas is not resized and ScrollView not applied.
By the way I dont recommend you using canvas for that prupose.
There is plenty of other layouts that will give you a better result such as StackPanel or WrapPanel, and if you give to WrapPanel a width it will nicely rearrange your items.
Related
I have problem with having ScrollViewer working.
This is my MainWindow XAML:
<Window x:Class="Labels.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:Labels"
mc:Ignorable="d"
Title="Labels" Height="350" Width="250" WindowStartupLocation="CenterScreen"
ResizeMode="NoResize" Background="#FFF6A300">
<ScrollViewer VerticalScrollBarVisibility="Hidden" Name="Scroll">
<Grid Margin="0,0,0,0" HorizontalAlignment="Center" Height="auto"
VerticalAlignment="Center" Name="mainGrid">
<Label x:Name="ProductLabel" Content="Product" HorizontalAlignment="Center"
Width="200" FontSize="16"
FontWeight="Bold" VerticalAlignment="Top"
HorizontalContentAlignment="Center" Margin="15,-5,9,0"/>
<TextBox x:Name="ProductTextBox" HorizontalAlignment="Center" Height="28"
Margin="13,22,11,0"
TextWrapping="Wrap" VerticalAlignment="Top" Width="200"
PreviewKeyDown="ProductTextBox_PreviewKeyDown"
SpellCheck.IsEnabled="True" FontSize="16"
HorizontalContentAlignment="Center"/>
<Label x:Name="IndexLabel" Content="Index: " HorizontalAlignment="Left"
Margin="10,50,0,0" VerticalAlignment="Top" Height="35" Width="62"/>
<Label x:Name="NameLabel" Content="Name:" HorizontalAlignment="Left"
Margin="10,80,0,0" VerticalAlignment="Top" Height="31" Width="62"/>
<TextBlock x:Name="IndexTextBlock" HorizontalAlignment="Left"
Margin="58,55,0,0" TextWrapping="Wrap" VerticalAlignment="Top"
Width="156" Height="23"/>
<TextBlock x:Name="NameTextBlock" HorizontalAlignment="Left"
Margin="58,85,0,0" TextWrapping="Wrap" VerticalAlignment="Top"
Width="155" Height="52"/>
<Label x:Name="TypeLabel" Content="Label template:"
HorizontalAlignment="Center" VerticalAlignment="Top" Height="30"
Width="199" FontSize="16" FontWeight="Bold"
Margin="15,142,10,0" HorizontalContentAlignment="Center"/>
<TextBox x:Name="TypeTextBox" HorizontalAlignment="Center"
Height="29" Margin="15,172,9,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="200"
PreviewKeyDown="TypeTextBox_PreviewKeyDown"
HorizontalContentAlignment="Center" FontSize="16"/>
<Label x:Name="CountLabel" Content="Print Copies: " HorizontalAlignment="Center"
Margin="14,206,10,0"
VerticalAlignment="Top" Height="31" Width="200" FontSize="16"
FontWeight="Bold" HorizontalContentAlignment="Center"/>
<TextBox x:Name="CountTextBox"
PreviewTextInput="CountTextBox_PreviewTextInput"
HorizontalAlignment="Center"
Height="28" Margin="13,232,11,0" TextWrapping="Wrap"
VerticalAlignment="Top" Width="200"
PreviewKeyDown="CountTextBox_PreviewKeyDown"
HorizontalContentAlignment="Center" FontSize="16"/>
<Label x:Name="LogoLabel" Content="Label" HorizontalAlignment="Left"
Margin="93,268,0,-8" VerticalAlignment="Top" Visibility="Hidden"/>
</Grid>
</ScrollViewer>
In code behind, I'm adding TextBox under LogoLabel and then I'm updating ScrollViewer's Layout like this:
mainGrid.Children.Add(nameTxt);
LogoLabel.Visibility = Visibility.Visible;
CountTextBox.IsEnabled = false;
nameTxt.Focus();
Scroll.UpdateLayout();
Scroll.ScrollToVerticalOffset(nameTxt.Margin.Top);
It looks like this:
As you can see on screenshoot uploaded above, I don't know how to make ScrollViewer to scroll that I could see entire LogoTextBox height. How to do it ? Any suggestions ?
You should scroll to a point outside of visible bounds. The Scroll.ScrollToVerticalOffset(nameTxt.Margin.Top) is already visible so no need to scroll.
You can try something like this:
Scroll.ScrollToVerticalOffset(nameTxt.Margin.Top + nameTxt.Height);
By doing this the scroll control will scroll to show the full text box.
The problem is with mainGrid height. It was set to auto. I changed it to static and in code I increase it's height by nameTxt height. And it works.
I have 2 textblocks on my form. I need to have vertical scrollbars in each of them. Due to some reason, I am not able to get the scrollbars on both. Kindly provide me with some idea.
<Grid>
<Button Content="COMPARE" HorizontalAlignment="Left" Margin="216,30,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click"/>
<TextBox x:Name="TextBox1" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Auto" HorizontalAlignment="Left" VerticalAlignment="Top" Margin="10,69,0,0" TextWrapping="Wrap" RenderTransformOrigin="-1.351,-2.164" Height="242" Width="226" Loaded="TextBox1_Loaded" />
<ScrollViewer>
<TextBlock x:Name="TextBlock1" HorizontalAlignment="Left" Margin="10,69,0,0" TextWrapping="Wrap" VerticalAlignment="Top" RenderTransformOrigin="-1.351,-2.164" Height="242" Width="226" Loaded="TextBlock1_Loaded" />
</ScrollViewer>
<TextBox x:Name="TextBox2" ScrollViewer.HorizontalScrollBarVisibility="Visible" ScrollViewer.VerticalScrollBarVisibility="Auto" HorizontalAlignment="Left" Margin="258,69,0,0" TextWrapping="Wrap" VerticalAlignment="Top" RenderTransformOrigin="-1.351,-2.164" Height="242" Width="226" Loaded="TextBox2_Loaded"/>
<ScrollViewer>
<TextBlock x:Name="TextBlock2" HorizontalAlignment="Left" Margin="258,69,0,0" TextWrapping="Wrap" VerticalAlignment="Top" RenderTransformOrigin="-1.351,-2.164" Height="242" Width="226" Loaded="TextBlock2_Loaded_1"/>
</ScrollViewer>
<Button Content="EDIT" HorizontalAlignment="Left" Margin="409,30,0,0" VerticalAlignment="Top" Width="75" Click="Button_Click_1"/>
<Button Content="HOME" HorizontalAlignment="Left" Margin="21,26,0,0" VerticalAlignment="Top" Width="75" RenderTransformOrigin="0.23,0.986" Click="Button_Click_2"/>
</Grid>
Try to check this out:
1. XAML Code:
<ScrollViewer Grid.Column="0" Grid.Row="0">
<TextBlock x:Name="ATextBlock" ></TextBlock></ScrollViewer>
<ScrollViewer Grid.Row="0" Grid.Column="1" >
<TextBlock x:Name="BtTextBlock" ></TextBlock></ScrollViewer>
the problem was; the Height definition on the TextBlock. Just remove it and that is.
regards.,
To show vertical scroll bar on a TextBox when needed you can use this XAML
<TextBox .... VerticalScrollBarVisibility="Auto" />
ScrollBar will apear when text does not fit the original space given to controll.
I´m working on a Windows Phone 8.1 c# app.
I´m trying to acces a textbox that is inside a tab page of a Hub. But whatever i do i can´t acces the textbox in the MainPage.xaml.cs code. Can anyone tell me why?
Here is my XAML code:
<Grid>
<Hub x:Name="Hub" Header="My Buddy!" Background="#FF303030">
<HubSection Tag="0" x:Name="HubSelection" Header="Hoofdscherm">
<DataTemplate>
<Grid>
<Button x:Name="btnAgenda" Content="Agenda" HorizontalAlignment="Left" Margin="20,17,0,0" VerticalAlignment="Top" Height="140" Width="140" RenderTransformOrigin="0.5,0.5" BorderBrush="White" Background="#FFD13535" Foreground="White" Click="btnAgenda_Click"/>
<Button x:Name="btnTaken" Content="Taken" HorizontalAlignment="Right" Margin="0,17,20,0" VerticalAlignment="Top" Height="140" Width="140" RenderTransformOrigin="0.5,0.5" BorderBrush="White" Background="#FFD13535" Foreground="White" Click="btnTaken_Click"/>
<Button x:Name="btnNieuweAfspraak" Content="Nieuwe afspraak" HorizontalAlignment="Left" Margin="20,161,0,0" VerticalAlignment="Top" Height="140" Width="140" RenderTransformOrigin="0.5,0.5" BorderBrush="White" Background="#FFD13535" Foreground="White" Click="btnNieuweAfspraak_Click"/>
<Button x:Name="btnNieuweTaak" Content="Nieuwe taak" HorizontalAlignment="Right" Margin="0,161,20,0" VerticalAlignment="Top" Height="140" Width="140" RenderTransformOrigin="0.5,0.5" BorderBrush="White" Background="#FFD13535" Foreground="White" Click="btnNieuweTaak_Click"/>
</Grid>
</DataTemplate>
</HubSection>
<HubSection Tag="1" Header="Agenda">
<DataTemplate>
<Grid>
<AppBarButton HorizontalAlignment="Left" Icon="Add" Label="Nieuwe afspraak" Margin="6,419,-2,0" VerticalAlignment="Top" Height="81" Width="337" Click="AppBarButton_Click"/>
</Grid>
</DataTemplate>
</HubSection>
<HubSection Tag="2" Header="Taken">
<DataTemplate>
<Grid>
<AppBarButton HorizontalAlignment="Left" Icon="Add" Label="Nieuwe taak" Margin="6,419,-2,0" VerticalAlignment="Top" Height="81" Width="337" Click="AppBarButton_Click_1" FontFamily="Global User Interface"/>
</Grid>
</DataTemplate>
</HubSection>
<HubSection Tag="3" x:Name="NewAfspraak" Header="Nieuwe afspraak">
<DataTemplate>
<Grid>
<TextBox x:Name="AfspraakBox" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="321" Height="47" PlaceholderText="Naam afspraak" TextChanged="AfspraakBox_TextChanged" IsColorFontEnabled="False"/>
<DatePicker x:Name="DatumAfspraak" HorizontalAlignment="Left" Margin="10,52,0,0" VerticalAlignment="Top" Height="55" Width="157"/>
<TimePicker x:Name="BegintijdAfspraak" HorizontalAlignment="Left" Margin="172,52,0,0" VerticalAlignment="Top" Height="53" Width="159"/>
<TextBox x:Name="tbLocatieAfspraak" HorizontalAlignment="Left" Margin="10,106,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="321" PlaceholderText="Locatie" Height="42"/>
<TextBox HorizontalAlignment="Left" Margin="10,165,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Height="255" Width="321" PlaceholderText="Omschrijving"/>
<Button x:Name="btnAfspraakOpslaan1" Content="Opslaan" HorizontalAlignment="Left" Margin="172,436,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Width="159" Height="63" Click="btnAfspraakOpslaan1_Click"/>
<Button x:Name="btnAfspraakOpslaan" Content="Annuleren" HorizontalAlignment="Left" Margin="10,436,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Width="157" Height="63" Click="btnAfspraakAnnuleren_Click"/>
</Grid>
</DataTemplate>
</HubSection>
<HubSection Tag="4" Header="Nieuwe taak">
<DataTemplate>
<Grid>
<TextBox x:Name="TbNaamTaak" HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="321" Height="47" PlaceholderText="Naam taak"/>
<TextBox x:Name="tbTaakOmschrijving" HorizontalAlignment="Left" Margin="10,168,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="321" Height="254" PlaceholderText="Omschrijving"/>
<TextBlock HorizontalAlignment="Left" Margin="172,62,0,0" TextWrapping="Wrap" Text="Eindtijd:" VerticalAlignment="Top" Height="14" Width="54"/>
<TextBlock HorizontalAlignment="Left" Margin="10,62,0,0" TextWrapping="Wrap" Text="Begintijd:" VerticalAlignment="Top" Height="14" Width="98"/>
<TimePicker x:Name="BegintijdNieuweTaak" HorizontalAlignment="Left" Margin="10,71,0,0" VerticalAlignment="Top" Width="157" Height="55" ToolTipService.ToolTip="Selecteer een begintijd:" FontFamily="Global User Interface"/>
<TimePicker x:Name="EindtijdNieuweTaak" HorizontalAlignment="Left" Margin="172,71,0,0" VerticalAlignment="Top" Width="159" Height="53" ToolTipService.ToolTip="Selecteer een eindtijd:"/>
<Button x:Name="btnTaakOpslaan" Content="Opslaan" HorizontalAlignment="Left" Margin="172,436,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Width="159" Height="63" FontFamily="Global User Interface" Click="btnTaakOpslaan_Click"/>
<Button Content="Annuleren" HorizontalAlignment="Left" Margin="10,436,0,0" VerticalAlignment="Top" RenderTransformOrigin="0.5,0.5" Width="157" Height="63" Click="btnTaakAnnuleren" FontFamily="Global User Interface"/>
<DatePicker x:Name="DatumNieuweTaak" HorizontalAlignment="Left" Margin="10,114,0,0" VerticalAlignment="Top" Height="81" Width="321" FontFamily="Global User Interface"/>
</Grid>
</DataTemplate>
</HubSection>
</Hub>
</Grid>
And my MainPage.xaml.cs code:
private void btnTaken_Click(object sender, RoutedEventArgs e)
{
String Test = AfspraakBox.text;
Hub.ScrollToSection(Hub.Sections[2]);
}
The error that i'm getting is:
AfspraakBox does not exist in the current context.
I'm pritty sure it has something to do with the Hubs. Because in a new project without a Hub it just works fine. But i just can't figure out why and how to fix it.
You can't access a XAML control inside of a DataTemplate. That's a problem of HubSections. It uses DataTemplate, unlike PivotItem.
How to make this code scroll'able?
I've tried this solution but it won't work: Need to scroll one WPF Grid
My XAML (Grid named Photos has to scroll):
<Grid Height="533" VerticalAlignment="Bottom">
<TextBox x:Name="siteAdressTextBox" HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" Text="http://www.etrapez.pl/" VerticalAlignment="Top" Width="215"/>
<Button x:Name="sendWebRequestButton" Content="Wyślij zapytanie" HorizontalAlignment="Left" Margin="10,38,0,0" VerticalAlignment="Top" Width="107" Click="webRequest"/>
<Button Content="Pobierz wszystko" HorizontalAlignment="Left" Margin="122,38,0,0" VerticalAlignment="Top" Width="103" Click="downThemAll"/>
<ScrollViewer HorizontalAlignment="Left" Height="460" Margin="10,63,0,0" VerticalAlignment="Top" Width="1000" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible" CanContentScroll="True">
<Grid x:Name="Photos" HorizontalAlignment="Left" Height="460" VerticalAlignment="Top" Width="1000" ShowGridLines="False" ScrollViewer.CanContentScroll="True" ScrollViewer.VerticalScrollBarVisibility="Visible" />
</ScrollViewer>
<TextBox Name="InfoBoxLabel" IsReadOnly="True" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Left" Height="48" Margin="230,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="300"/>
</Grid>
try this
<Grid Height="533" VerticalAlignment="Bottom">
<TextBox x:Name="siteAdressTextBox" HorizontalAlignment="Left" Height="23" Margin="10,10,0,0" TextWrapping="Wrap" Text="http://www.etrapez.pl/" VerticalAlignment="Top" Width="215"/>
<Button x:Name="sendWebRequestButton" Content="Wyślij zapytanie" HorizontalAlignment="Left" Margin="10,38,0,0" VerticalAlignment="Top" Width="107"/>
<Button Content="Pobierz wszystko" HorizontalAlignment="Left" Margin="122,38,0,0" VerticalAlignment="Top" Width="103" />
<ScrollViewer HorizontalAlignment="Left" Height="460" Margin="10,63,0,0" VerticalAlignment="Top" Width="1000" HorizontalScrollBarVisibility="Disabled" VerticalScrollBarVisibility="Visible">
<Grid x:Name="Photos" ShowGridLines="False">
<TextBlock TextWrapping="Wrap" Text="text here"/>
</Grid>
</ScrollViewer>
<TextBox Name="InfoBoxLabel" IsReadOnly="True" VerticalScrollBarVisibility="Auto" HorizontalAlignment="Left" Height="48" Margin="230,10,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="300"/>
</Grid>
Output will be http://prntscr.com/3w0cr9
I started learning Windows 8 app development (I'm a beginner) and I'm making an app where I want to add its tile icon. When I press the window key, then our program exe icon shows as default, but I want to add my own icon. How do I do this?
How do I add an image in this sample code?
<Page
x:Class="Calculator.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:Calculator"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Grid Background="Tomato">
<Button x:Name="btn0" Content="0" HorizontalAlignment="Left" Height="64" Margin="458,459,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn1" Content="1" HorizontalAlignment="Left" Height="64" Margin="458,390,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn2" Content="2" HorizontalAlignment="Left" Height="64" Margin="583,390,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn3" Content="3" HorizontalAlignment="Left" Height="64" Margin="708,390,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn4" Content="4" HorizontalAlignment="Left" Height="64" Margin="458,321,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn5" Content="5" HorizontalAlignment="Left" Height="64" Margin="578,321,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn6" Content="6" HorizontalAlignment="Left" Height="64" Margin="708,321,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn7" Content="7" HorizontalAlignment="Left" Height="64" Margin="458,252,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn8" Content="8" HorizontalAlignment="Left" Height="64" Margin="583,252,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<Button x:Name="btn9" Content="9" HorizontalAlignment="Left" Height="64" Margin="708,252,0,0" VerticalAlignment="Top" Width="120" FontSize="36" FontWeight="Bold" Click="showbtn"/>
<TextBox x:Name="Output" HorizontalAlignment="Left" Height="68" Margin="458,179,0,0" TextWrapping="Wrap" VerticalAlignment="Top" Width="370" FontSize="24"/>
</Grid>
</Page>
You can replace the default tile image with your own logo image with the path in the package .appxmanifest
You can get the guidelines over here http://msdn.microsoft.com/en-us/library/windows/apps/hh465437.aspx
Hope it will solve your problem