c# - Strange behavior in circular textbox wpf project -


i have page in wpf project in visual studio 2013

but when execute it, show this:

if maximize it, show this:

enter image description here

this xaml page code:

<page x:class="controldomotico.client.menuprincipal"   xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"    mc:ignorable="d" title="menuprincipal" d:designheight="633.654" d:designwidth="877.835">  <grid>     <grid.background>         <imagebrush imagesource="d:\documents\visual studio 2013\projects\controldomotico\controldomotico.client\images\menu.jpg">             <imagebrush.transform>                 <transformgroup>                     <scaletransform scaley="1.05"/>                     <skewtransform/>                     <rotatetransform/>                     <translatetransform x="-11"/>                 </transformgroup>             </imagebrush.transform>         </imagebrush>     </grid.background>     <label content="bienvenido tu casa" fontsize="30px" horizontalalignment="left" verticalalignment="top" rendertransformorigin="10.453,3.723" height="53" width="309" margin="10,10,0,0" horizontalcontentalignment="center" verticalcontentalignment="center" background="#00000000" foreground="#ff0f0101" fontweight="bold"/>      <button name="clavebtn" width="100" content="cambiar clave"     height="100" margin="439,40,339,493.6" >         <button.template>             <controltemplate targettype="button">                 <grid>                     <ellipse stroke="black"                      strokethickness="2">                         <ellipse.fill>                             <radialgradientbrush>                                 <gradientstop offset="0"                                       color="gold" />                                 <gradientstop offset="1"                                       color="gold" />                                 <gradientstop offset="1"                                       color="gold" />                                 <radialgradientbrush.transform>                                     <transformgroup>                                         <scaletransform scaley="0.65" />                                     </transformgroup>                                 </radialgradientbrush.transform>                             </radialgradientbrush>                         </ellipse.fill>                     </ellipse>                     <contentpresenter horizontalalignment="center"                               verticalalignment="center"/>                 </grid>             </controltemplate>         </button.template>     </button>     <button name="alarmabtn" width="100" content="configurar alarma"         height="100" margin="588,95,190,438.6">         <button.template>             <controltemplate targettype="{x:type button}">                 <grid>                     <ellipse stroke="black"                         strokethickness="2">                         <ellipse.fill>                             <radialgradientbrush>                                 <radialgradientbrush.transform>                                     <transformgroup>                                         <scaletransform scaley="0.65" />                                     </transformgroup>                                 </radialgradientbrush.transform>                                 <gradientstop offset="0"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                             </radialgradientbrush>                         </ellipse.fill>                     </ellipse>                     <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                 </grid>             </controltemplate>         </button.template>     </button>     <button name="horabtn" width="100" content="cambiar hora"         height="100" margin="732,198,46,335.6" click="horabtn_click">         <button.template>             <controltemplate targettype="{x:type button}">                 <grid>                     <ellipse stroke="black"                         strokethickness="2">                         <ellipse.fill>                             <radialgradientbrush>                                 <radialgradientbrush.transform>                                     <transformgroup>                                         <scaletransform scaley="0.65" />                                     </transformgroup>                                 </radialgradientbrush.transform>                                 <gradientstop offset="0"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                             </radialgradientbrush>                         </ellipse.fill>                     </ellipse>                     <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                 </grid>             </controltemplate>         </button.template>     </button>     <button name="puertabtn" width="100" content="puerta"         height="100" margin="607,308,171,225.6">         <button.template>             <controltemplate targettype="{x:type button}">                 <grid>                     <ellipse stroke="black"                         strokethickness="2">                         <ellipse.fill>                             <radialgradientbrush>                                 <radialgradientbrush.transform>                                     <transformgroup>                                         <scaletransform scaley="0.65" />                                     </transformgroup>                                 </radialgradientbrush.transform>                                 <gradientstop offset="0"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                             </radialgradientbrush>                         </ellipse.fill>                     </ellipse>                     <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                 </grid>             </controltemplate>         </button.template>     </button>     <button name="iluminacionbtn" width="100" content="iluminación"         height="100" margin="588,463,190,70.6">         <button.template>             <controltemplate targettype="{x:type button}">                 <grid>                     <ellipse stroke="black"                         strokethickness="2">                         <ellipse.fill>                             <radialgradientbrush>                                 <radialgradientbrush.transform>                                     <transformgroup>                                         <scaletransform scaley="0.65" />                                     </transformgroup>                                 </radialgradientbrush.transform>                                 <gradientstop offset="0"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                             </radialgradientbrush>                         </ellipse.fill>                     </ellipse>                     <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                 </grid>             </controltemplate>         </button.template>     </button>     <button name="banerabtn" width="100" content="bañera"         height="100" margin="439,508,339,25.6">         <button.template>             <controltemplate targettype="{x:type button}">                 <grid>                     <ellipse stroke="black"                         strokethickness="2">                         <ellipse.fill>                             <radialgradientbrush>                                 <radialgradientbrush.transform>                                     <transformgroup>                                         <scaletransform scaley="0.65" />                                     </transformgroup>                                 </radialgradientbrush.transform>                                 <gradientstop offset="0"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                                 <gradientstop offset="1"                                     color="gold" />                             </radialgradientbrush>                         </ellipse.fill>                     </ellipse>                     <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                 </grid>             </controltemplate>         </button.template>     </button> </grid> 

i dont understand behavior, can me please?

the size of window clashes margins have set on buttons reason. advise design code in xaml editor using rowdefinitions & column definitions on grid rather in xaml designer. quick-fix solution be:

a: increase window/page size 833 x 933 or similar.

b: enclose code in viewbox so:

<viewbox>     <grid background="red">          <label content="bienvenido tu casa" fontsize="30px" horizontalalignment="left" verticalalignment="top" rendertransformorigin="10.453,3.723" height="53" width="309" margin="10,10,0,0" horizontalcontentalignment="center" verticalcontentalignment="center" background="#00000000" foreground="#ff0f0101" fontweight="bold"/>          <button name="clavebtn" width="100" content="cambiar clave"     height="100" margin="664,445.5,106,257.5"  >             <button.template>                 <controltemplate targettype="button">                     <grid>                         <ellipse stroke="black"                      strokethickness="2">                             <ellipse.fill>                                 <radialgradientbrush>                                     <gradientstop offset="0"                                       color="gold" />                                     <gradientstop offset="1"                                       color="gold" />                                     <gradientstop offset="1"                                       color="gold" />                                     <radialgradientbrush.transform>                                         <transformgroup>                                             <scaletransform scaley="0.65" />                                         </transformgroup>                                     </radialgradientbrush.transform>                                 </radialgradientbrush>                             </ellipse.fill>                         </ellipse>                         <contentpresenter horizontalalignment="center"                               verticalalignment="center"/>                     </grid>                 </controltemplate>             </button.template>         </button>         <button name="alarmabtn"  cliptobounds="true" content="configurar alarma" width="100" height="100" click="alarmabtn_click" margin="581,103.55,189,599.45">             <button.template>                 <controltemplate targettype="{x:type button}">                     <grid>                         <ellipse stroke="black"                         strokethickness="2">                             <ellipse.fill>                                 <radialgradientbrush>                                     <radialgradientbrush.transform>                                         <transformgroup>                                             <scaletransform scaley="0.65" />                                         </transformgroup>                                     </radialgradientbrush.transform>                                     <gradientstop offset="0"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                 </radialgradientbrush>                             </ellipse.fill>                         </ellipse>                         <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                     </grid>                 </controltemplate>             </button.template>         </button>         <button name="horabtn" width="100" content="cambiar hora"         height="100" margin="485,597.5,285,105.5"  >             <button.template>                 <controltemplate targettype="{x:type button}">                     <grid>                         <ellipse stroke="black"                         strokethickness="2">                             <ellipse.fill>                                 <radialgradientbrush>                                     <radialgradientbrush.transform>                                         <transformgroup>                                             <scaletransform scaley="0.65" />                                         </transformgroup>                                     </radialgradientbrush.transform>                                     <gradientstop offset="0"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                 </radialgradientbrush>                             </ellipse.fill>                         </ellipse>                         <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                     </grid>                 </controltemplate>             </button.template>         </button>         <button name="puertabtn" width="100" content="puerta"         height="100" margin="689,236.5,81,466.5" >             <button.template>                 <controltemplate targettype="{x:type button}">                     <grid>                         <ellipse stroke="black"                         strokethickness="2">                             <ellipse.fill>                                 <radialgradientbrush>                                     <radialgradientbrush.transform>                                         <transformgroup>                                             <scaletransform scaley="0.65" />                                         </transformgroup>                                     </radialgradientbrush.transform>                                     <gradientstop offset="0"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                 </radialgradientbrush>                             </ellipse.fill>                         </ellipse>                         <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                     </grid>                 </controltemplate>             </button.template>         </button>         <button name="iluminacionbtn" width="100" content="iluminación"         height="100" margin="385,58.5,385,644.5" >             <button.template>                 <controltemplate targettype="{x:type button}">                     <grid>                         <ellipse stroke="black"                         strokethickness="2">                             <ellipse.fill>                                 <radialgradientbrush>                                     <radialgradientbrush.transform>                                         <transformgroup>                                             <scaletransform scaley="0.65" />                                         </transformgroup>                                     </radialgradientbrush.transform>                                     <gradientstop offset="0"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                 </radialgradientbrush>                             </ellipse.fill>                         </ellipse>                         <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                     </grid>                 </controltemplate>             </button.template>         </button>         <button name="banerabtn" width="100" content="bañera"         height="100" margin="204,629.5,566,73.5" >             <button.template>                 <controltemplate targettype="{x:type button}">                     <grid>                         <ellipse stroke="black"                         strokethickness="2">                             <ellipse.fill>                                 <radialgradientbrush>                                     <radialgradientbrush.transform>                                         <transformgroup>                                             <scaletransform scaley="0.65" />                                         </transformgroup>                                     </radialgradientbrush.transform>                                     <gradientstop offset="0"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                     <gradientstop offset="1"                                     color="gold" />                                 </radialgradientbrush>                             </ellipse.fill>                         </ellipse>                         <contentpresenter horizontalalignment="center"                         verticalalignment="center"/>                     </grid>                 </controltemplate>             </button.template>         </button>     </grid>     </viewbox> 

Comments

Popular posts from this blog

android - Gradle sync Error:Configuration with name 'default' not found -

java - Andrioid studio start fail: Fatal error initializing 'null' -

html - jQuery UI Sortable - Remove placeholder after item is dropped -