Bind visibility property to a variable

You don’t need to make any converter. Add a binding to a Visibility property for the border: <Border x:Name=”Border1″ Visibility=”{Binding Visibility}” BorderBrush=”Black” BorderThickness=”1″ HorizontalAlignment=”Left” Height=”21″ Margin=”229,164,0,0″ VerticalAlignment=”Top” Width=”90″ Opacity=”0.5″> <Grid> <Label Content=”test”/> </Grid> </Border> And then create the Visibility property in your ViewModel: private Visibility visibility; public Visibility Visibility { get { return visibility; } … Read more

How to change the border color(un-focused) of an EditText?

Create a XML file with the following in drawable (say backwithborder.xml): <shape xmlns:android=”http://schemas.android.com/apk/res/android” android:shape=”rectangle”> <solid android:color=”#00000000″ /> <stroke android:width=”1dip” android:color=”#ffffff” /> </shape> and for the EditText user attribute android:background=”@drawable/backwithborder”

How can I achieve a dashed or dotted border in WPF?

This worked great in our application, allowing us to use a real Border and not mess around with Rectangles: <Border BorderThickness=”1,0,1,1″> <Border.BorderBrush> <DrawingBrush Viewport=”0,0,8,8″ ViewportUnits=”Absolute” TileMode=”Tile”> <DrawingBrush.Drawing> <DrawingGroup> <GeometryDrawing Brush=”Black”> <GeometryDrawing.Geometry> <GeometryGroup> <RectangleGeometry Rect=”0,0,50,50″ /> <RectangleGeometry Rect=”50,50,50,50″ /> </GeometryGroup> </GeometryDrawing.Geometry> </GeometryDrawing> </DrawingGroup> </DrawingBrush.Drawing> </DrawingBrush> </Border.BorderBrush> <TextBlock Text=”Content Goes Here!” Margin=”5″/> </Border> Note that the Viewport … Read more

CSS Inset Borders

You could use box-shadow, possibly: #something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; box-shadow: inset 0 0 10px #0f0; } #something { background: transparent url(https://i.stack.imgur.com/RL5UH.png) 50% 50% no-repeat; min-width: 300px; min-height: 300px; box-shadow: inset 0 0 10px #0f0; } <div id=”something”></div> This has the advantage that it will overlay the background-image … Read more

text flowing out of div

It’s due to the fact that you have one long word without spaces. You can use the word-wrap property to cause the text to break: #w74 { word-wrap: break-word; } It has fairly good browser support, too. See documentation about it here.

Creating space between an element and its border

You want padding. Here’s a link to a site that demonstrates “margin”, “border”, and “padding” for an element. http://css-tricks.com/the-css-box-model/ However, there used to be a problem with IE’s rendering of the box model and the “rest of the world” in that IE used a different mechanism to determine “overall width”. You need to understand that … Read more

Border over a bitmap with rounded corners in Android

I put the following together for myself. public static Bitmap getRoundedCornerBitmap(Bitmap bitmap, int color, int cornerDips, int borderDips, Context context) { Bitmap output = Bitmap.createBitmap(bitmap.getWidth(), bitmap.getHeight(), Bitmap.Config.ARGB_8888); Canvas canvas = new Canvas(output); final int borderSizePx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, (float) borderDips, context.getResources().getDisplayMetrics()); final int cornerSizePx = (int) TypedValue.applyDimension(TypedValue.COMPLEX_UNIT_DIP, (float) cornerDips, context.getResources().getDisplayMetrics()); final Paint paint = new … Read more