Click here to Skip to main content
15,845,785 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Dear all,

I have developed a project in WPF.
Label names are fully displayed on my system while running the project, but on some systems, label names are partially displayed when running the same executable.

Example:
label Name: User Name

My System: User Name
Some Systems: User N


Someone told me, this problem is a system resolution problem. I have changed the system resolution (other system resolution values). The label name are correctly displayed after running the executable.

Please help me with the solution.

Thanks.

Regards,
Mahalakshmi S.

[From OP's comment]

XML
<usercontrol x:class="e_cdsl.Export.TransactionExportNew" 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" xmlns:txt="clr-namespace:ewebcontrols;assembly=ewebcontrols" xmlns:sys="clr-namespace:System;assembly=mscorlib" xmlns:col="clr-namespace:System.Collections;assembly=mscorlib" mc:ignorable="d" height="669" width="1019" loaded="UserControl_Loaded" xmlns:decimal="clr-namespace:e_cdsl.Classes" xmlns:my="clr-namespace:E_Cdsl_Tools;assembly=E-Cdsl_Tools" xmlns:my1="clr-namespace:e_cdsl.Classes" xmlns:my2="clr-namespace:e_cdsl.Custom_Controls" xmlns:my3="clr-namespace:e_cdsl.Usercontrols" removed="Transparent" focusable="True" name="usr_ep">
    <usercontrol.resources>
        &lt;Style x:Key="SingleClick" TargetType="{x:Type DataGridCell}"&gt;
            &lt;!--<eventsetter event="PreviewMouseLeftButtonDown" handler="DataGridCell_ButtonDown"></eventsetter>--&gt;
        &lt;/Style&gt;
        <my1:accountconverts x:key="deci">
        &lt;Style x:Key="RightAlignStyle" TargetType="{x:Type TextBlock}"&gt;
            <setter property="TextAlignment" value="Right">
        &lt;/Style&gt;
    </setter></my1:accountconverts></usercontrol.resources>
    <border borderthickness="5" margin="0,0,0,75" borderbrush="#FF2A2835" removed="#FFB9C3D5" height="591" width="1014">
        <canvas x:name="layout" width="1004" margin="0,-5,-22,7" height="600">
            <canvas name="can_popup" canvas.left="93" canvas.top="36" height="468" width="320" opacitymask="Black" removed="LightGray" visibility="Collapsed">
                <datagrid isreadonly="True" autogeneratecolumns="False" selectedvaluepath="acct_code" canvas.left="0" canvas.top="60" height="358" name="grd_popup" width="320" gridlinesvisibility="Vertical">
                    <datagrid.columns>
                        <datagridtextcolumn binding="{Binding acct_code}" header="Code" canuserresize="False" canusersort="False">
                        <datagridtextcolumn binding="{Binding acct_name}" header="Name" canuserresize="False" canusersort="False">
                    </datagridtextcolumn></datagridtextcolumn></datagrid.columns>
                </datagrid>
                &lt;Button Canvas.Left="69" Canvas.Top="433" Content="Se_lect" Height="23" Name="btn_select" Width="75" /&gt;
                &lt;Button Canvas.Left="184" Canvas.Top="433" Content="_Exit" Height="23" Name="btn_popexit" Width="75" /&gt;
                &lt;Label Canvas.Left="139" Canvas.Top="1" Content="Loop Up" Height="28" Name="label16" /&gt;
                <textbox canvas.left="27" canvas.top="32" charactercasing="Upper" fontfamily="Calibri" fontsize="13" height="22" maxlines="20" name="txt_search" visibility="Visible" width="142">
                &lt;Label Canvas.Left="178" Canvas.Top="34" Content="Search By Code " FontFamily="Calibri" FontSize="14" FontWeight="Bold" Foreground="Black" Height="16" HorizontalContentAlignment="left" Name="lbl_search" Padding="0" Visibility="Visible" Width="133" /&gt;
                &lt;Image Canvas.Left="0" Canvas.Top="34" Height="21" Name="image1" Source="/e_cdsl;component/Icon/small-search.bmp" Stretch="None" Width="31" /&gt;
            </textbox></canvas>
            &lt;Path Canvas.Top="92" Data="M245,61 L809,61" Fill="#FF020204" Height="1" Stretch="Fill" Stroke="Black" StrokeEndLineCap="Flat" StrokeLineJoin="Miter" StrokeMiterLimit="10" StrokeStartLineCap="Flat" StrokeThickness="3" Width="742" Canvas.Left="-7" /&gt;
            <rectangle canvas.left="-7" canvas.top="36" fill="#00B9C3D5" height="508" stroke="Black" width="741">
            </rectangle></canvas></border></usercontrol>
Posted
Updated 27-Nov-11 21:18pm
v4
Comments
Mark Salsbery 18-Nov-11 11:13am    
In WPF it's easier than ever to prevent this. You need to use appropriate elements that behave the way you need them to when positioning child elements and don't use hard-coded positions and dimensions.
Sergey Alexandrovich Kryukov 18-Nov-11 13:35pm    
That's true.
--SA
Sergey Alexandrovich Kryukov 18-Nov-11 13:36pm    
It's not resolution but your layout. How can we see where the problem is without a code sample?
--SA
lakshmi.ksangam 19-Nov-11 2:38am    
Added code in question.

1 solution

The biggest problem is that you are using hardcoded sizes in your xaml. You need to avoid this as much as possible, instead you should try use Margins and set the relative sizes of things in a grid using the "*" and "Auto" settings.
 
Share this answer
 

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

  Print Answers RSS


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