How to style a WPF Expander Header?

I have combined some XAML from Josh Smith and MSDN and came up with a solution. Indeed, the control (al least the header) must be retemplated. <Page xmlns=”http://schemas.microsoft.com/winfx/2006/xaml/presentation” xmlns:x=”http://schemas.microsoft.com/winfx/2006/xaml” Width=”400″> <StackPanel> <StackPanel.Resources> <Style TargetType=”Border” x:Key=”RacePitBorderStyle” > <Style.Resources> <LinearGradientBrush x:Key=”BackBrush” StartPoint=”0.5,0″ EndPoint=”0.5,1″> <GradientStop Color=”#EF3132″ Offset=”0.1″ /> <GradientStop Color=”#D62B2B” Offset=”0.9″ /> </LinearGradientBrush> </Style.Resources> <Setter Property=”Background” Value=”{StaticResource BackBrush}”/> … Read more

Not targeting the latest versions of Android

It says this because of targetSdkVersion=”16″. API 16 is Jellybean 4.1 and 4.1.1, while Jellybean 4.2 is API 17. Try using: <uses-sdk android:minSdkVersion=”8″ android:targetSdkVersion=”17″ /> Also, keep in mind that this is a Lint warning. These warning exist to help you better your code and make it easy to maintain, while being compatible with the … Read more

WPF TreeView: How to style selected items with rounded corners like in Explorer

Adding to @Sheridan’s answer This isn’t a 100% accurate but should get you pretty close (it’s using the colors from GridView which is pretty close to Windows Explorer) <TreeView …> <TreeView.Resources> <LinearGradientBrush x:Key=”{x:Static SystemColors.HighlightBrushKey}” EndPoint=”0,1″ StartPoint=”0,0″> <GradientStop Color=”#FFD9F4FF” Offset=”0″/> <GradientStop Color=”#FF9BDDFB” Offset=”1″/> </LinearGradientBrush> <LinearGradientBrush x:Key=”{x:Static SystemColors.ControlBrushKey}” EndPoint=”0,1″ StartPoint=”0,0″> <GradientStop Color=”#FFEEEDED” Offset=”0″/> <GradientStop Color=”#FFDDDDDD” Offset=”1″/> </LinearGradientBrush> … Read more

Android toggle button custom look

create toggle_selector.xml in res/drawable <?xml version=”1.0″ encoding=”utf-8″?> <selector xmlns:android=”http://schemas.android.com/apk/res/android”> <item android:drawable=”@drawable/toggle_on” android:state_checked=”true”/> <item android:drawable=”@drawable/toggle_off” android:state_checked=”false”/> </selector> apply the selector to your toggle button <ToggleButton android:id=”@+id/chkState” android:layout_width=”wrap_content” android:layout_height=”wrap_content” android:background=”@drawable/toggle_selector” android:textOff=”” android:textOn=””/> Note: for removing the text i used following in above code textOff=”” textOn=””

How to add global style to angular 6/7 library

I have a workaround for this. Just create the root component of your library without view encapsulation and all its styles will be then global. my-library.component.ts import { Component, OnInit, ViewEncapsulation } from ‘@angular/core’; @Component({ selector: ‘lib-my-library’, templateUrl: ‘./my-library.component.html’, styleUrls: [‘./my-library.component.scss’], encapsulation: ViewEncapsulation.None }) export class MyLibraryComponent implements OnInit { constructor() { } ngOnInit() { … Read more

CSS align images and text on same line

You can either use (on the h4 elements, as they are block by default) display: inline-block; Or you can float the elements to the left/rght float: left; Just don’t forget to clear the floats after clear: left; More visual example for the float left/right option as shared below by @VSB: <h4> <div style=”float:left;”>Left Text</div> <div … Read more

Setting Button FlatStyle in WPF

The ToolBar class defines a Style that makes Buttons look flat. An example of using it is: <Button Style=”{StaticResource {x:Static ToolBar.ButtonStyleKey}}”/> This also works for a ToggleButton when using ToggleButtonStyleKey. WPF lets you completely restyle controls to make them look like whatever you want, which is why it doesn’t have such a specific FlatStyle property … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)