This is a migrated thread and some comments may be shown as answers.

Need To set Canvas Margin based on TextBlock text Lenght

3 Answers 57 Views
RichTextBox
This is a migrated thread and some comments may be shown as answers.
Ramesh
Top achievements
Rank 1
Ramesh asked on 25 Sep 2014, 07:40 AM
Hi Telrik,

In project , I  I have a requirment that is when i enter data in a textbox  that ented text is displinh in a Textblox based on text block lenght canvs control margin need to set .

if you see the image the lable is  size is increasing to right side when test increases but i need that size has to increse both the sides means left side and right side also.

kindly see the follwing code bellow .

have a look to atttached pictures please

it is urgent please help me as soon as possible.


<Canvas x:Name="wpRect" Canvas.Left="85" Canvas.Top="-32" Width="30" Height="30">

<!-- // Demond Id 541: following code is for to change circlequantity to Rectangle Quantity. Done by Ramesh 878173 -->
<Border BorderThickness="1" BorderBrush="Black" MinWidth="30" MaxWidth="100" Background="White">
<Grid>
<TextBlock x:Name="lblWPQtyCircle" Canvas.Left="4" Canvas.Top="7" Height="20" Text="{Binding Quantity}" ToolTipService.ToolTip="{Binding Quantity}"
Width="Auto" TextAlignment="Center" FontFamily="Arial Black" HorizontalAlignment="Center"
MouseLeftButtonUp="lblWPQtyCircle_MouseLeftButtonUp" MouseEnter="lblWpQtyCircle_MouseEnter"
MouseLeave="lblWPQtyCirle_MouseLeave" RenderTransformOrigin="0.5,0.5" SizeChanged="lblWPQtyCircle_SizeChanged">
<TextBlock.RenderTransform>
<CompositeTransform/>
</TextBlock.RenderTransform>
</TextBlock>
<TextBox x:Name="txtWPQtyCircle" Visibility="Collapsed" Canvas.Left="4" Canvas.Top="5" MinWidth="30" Height="20" Text="{Binding Quantity, Mode=TwoWay}"
CAST_Common_Controls:TextBoxFilter.Filter="PositiveInteger" Width="Auto" TextAlignment="Center" FontFamily="Arial Black"
KeyUp="txtWPQtyCircle_KeyUp" LostFocus="txtWpQtyCircle_LostFocus" RenderTransformOrigin="0.2,0.2"
FontSize="13" Style="{StaticResource CircleTextBoxStyle}">
</TextBox>
</Grid>
</Border>
<!--End 541-->
</Canvas>

3 Answers, 1 is accepted

Sort by
0
Ramesh
Top achievements
Rank 1
answered on 29 Sep 2014, 06:14 AM
Hi Team ,
 
could help on this please . I awiating for your support.
0
Petya
Telerik team
answered on 29 Sep 2014, 04:21 PM
Hello Ramesh,

This question does not seem related to any of the controls in the Telerik UI for Silverlight suite, so I'd suggest addressing it either in the MSDN forums or another developer community forum like Stack Overflow.

I also did a quick internet search and there seem to be numerous resources discussing the topic, for example:
If you have any question concerning any of the Telerik controls please let us know and we will gladly assist you.

Regards,
Petya
Telerik
 
Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
 
0
Ramesh
Top achievements
Rank 1
answered on 01 Oct 2014, 09:41 AM
Hi ,

Thank you so much it working fin as per your suggesion
Tags
RichTextBox
Asked by
Ramesh
Top achievements
Rank 1
Answers by
Ramesh
Top achievements
Rank 1
Petya
Telerik team
Share this question
or