FAQ Database Discussion Community


How to set a borderless button which changes its color when mouse hovering in WPF

c#,wpf,xaml,button,styles
I want to override all my button's style to a borderless grayish button which highlights when hover on. I wrote like below: If I remove the template section (I even have no idea of what does it do), the button will have a border even if I have set BorderThickness...

No resource found that matches the given name '@android:style/Widget.AppCompat.Light.ActionBar.Solid.Inverse'

android,xml,styles,android-manifest
Sorry for my english. I try change action bar collor. And i have this error: error: Error retrieving parent for item: No resource found that matches the given name '@android:style/ Widget.AppCompat.Light.ActionBar.Solid.Inverse'. I have minSdkVersion = 12 style.xml <resources xmlns:tools="http://schemas.android.com/tools" xmlns:android="http://schemas.android.com/apk/res/android"> <style name="MyTheme" parent="@android:style/Theme.Holo.Light"> <item name="android:actionBarStyle">@style/MyActionBar</item>...

Print a list with the original style

python,list,printing,styles
I'm using python and I've got a txt database with values like 24,50,55,5754 Now I want to print for example the last three digits in the same style: Output: 50,55,5754 I created a list: str.split(",") And then want to print: print (str[1:4]) However it then of course prints it like:...

JavaFX css themes

css,user-interface,javafx,styles,themes
Are there any free, ready-to-use css themes to customize the overall look & feel of a JavaFX application, like the default modena.css? It would be nice to gather here a list of available stylesheets....

How to change colors of Gui-elements belonging to preferences?

android,styles,preferences
I have a PreferenceFragment, which displays several kinds of Preferences. Is it possible to change that blue color of the switch which belongs to a SwitchPreference and the radio buttons, line and title of the dialog which belongs to the ListPreference by assigning own colors to style-attributes ? My base...

TimePicker not displaying on android 4.4.2 - screenshots attached

android,dialog,styles,android-4.4-kitkat,timepicker
I have 2 phones, a Nexus 4 with Android 5.0.1, and an LG f60 with Android 4.4.2 on it. I have a custom dialog with this layout: <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:id="@+id/linearLayout1" android:layout_width="fill_parent" android:layout_height="fill_parent" android:gravity="center" android:orientation="vertical" > <DatePicker android:id="@+id/datePicker1" android:layout_width="wrap_content" android:layout_height="wrap_content" android:calendarViewShown="false" >...

How can I have a TextBox style with properties of other TextBox style

wpf,styles
I made an TextBox style but now i need some differences for example an other corner radius. This is my default style: <Style TargetType="TextBox"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type TextBoxBase}"> <Border CornerRadius="10" Padding="2" Background="{DynamicResource DefaultItemBGBrush}" BorderBrush="#C2C2C2" BorderThickness="1" > <ScrollViewer Margin="0" x:Name="PART_ContentHost" FontWeight="Bold" Foreground="#8D8D8D"/> </Border> </ControlTemplate>...

PHP String for HTML style

php,html,css,string,styles
I want to show a png file in background of a div. I have this CSS style for put it in the correct place. I'v tested directly in my HTML and the style works properly. I't doesn't work wen I use php variable. <?php if ($RScoluna1['nova'] == 1){ $style =...

How to remove button border style?

button,styles,autohotkey
In autohotkey, how do you remove the black button border? I just want a button without any border on it. I've tried all these style modifiers to no avail. gui, add, button, hwndMyButton Control, Style, -0x0,, ahk_id %MyButton% ;remove BS_PUSHBUTTON Control, Style, -0x1,, ahk_id %MyButton% ;remove BS_DEFPUSHBUTTON Control, Style, +0x8000,,ahk_id...

while Inherit style in WPF it affect parent style

c#,xaml,styles,wpf-controls
In WPF i have a style for the control like below, <Style TargetType="local:CustomControl"> <Setter Property="Background" Value="Transparent" /> <Setter Property="BorderBrush" Value="Gray" /> <Setter Property="BorderThickness" Value="0,0,0,1" /> <Setter Property="Padding" Value="3,0,3,0" /> <Setter Property="IsTabStop" Value="False" /> <Setter Property="VerticalContentAlignment" Value="Center" /> </Style> Now i need to override customcontrol border for some other place like...

WPF add new Slider style cause XamlParseException

wpf,slider,styles
i found this slider style that i want to add. i added all the 3 styles inside my Window.Resources and also put in the first style the 2 templates: <Style TargetType="{x:Type Slider}"> <Setter Property="FocusVisualStyle" Value="{StaticResource MyFocusVisualStyte}" /> <Setter Property="SnapsToDevicePixels" Value="true" /> <Setter Property="OverridesDefaultStyle" Value="true" /> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type...

Base.Widget.AppCompat.Button vs Widget.AppCompat.Button

android,styles,appcompat
I´m Using AppCompat 22.1.1 What´s the difference between Base.Widget.AppCompat.Buttonand Widget.AppCompat.Button ?...

How to base a style on an inherited style

c#,wpf,styles
So I have a Master Detail page. And in my Master page I have a style that will set the style for all buttons. Master Page <Style TargetType="Button"> <Setter Property="Background" Value="White" /> <Setter Property="TextBlock.TextAlignment" Value="Center" /> <Setter Property="RenderTransformOrigin" Value="-0.893,-11.7"/> <Setter Property="VerticalAlignment" Value="Center"/> </Style> in my Detail Page I have a...

Constructing book cover using div and CSS

html,css,styles
Is it possible to use some divs and css to make a book cover like the one below(ignore the orange background) with editable titles, most the book covers I checked online don't look like this. I know am probably asking a lot but I would really appreciate any help on...

Style only one anchor link with class applied to li

css,styles,stylesheet
Struggling with this one but I'm sure it's quite easy! WordPress is applying a class "current_page_item" to the <li> that surrounds my anchor link in my side menu. I want to bold the current page item only. I have some sub menus being nested like so: <ul class="menu"> <li class="current_page_item">...

The position of int main() function [closed]

c++,function,styles,main,writing
I know that it's possible to write a code in that way: void foo() {...} void bar() {...} string qix(){...} int main() { //functions calling } And also it's possible to write the same like: /* function's prototypes here*/ int main() { //functions calling } void foo() {...} void bar()...

WPF - How to highlight a combobox border when focused

wpf,combobox,styles
I trying to create an application combo box theme. However I need the combo box border to change colour when tabbed to. I've tried everything, but I can't seem to get it right. Any help would be appreciated. <SolidColorBrush x:Key="NouvemWhiteBrush">White</SolidColorBrush> <SolidColorBrush x:Key="NouvemSecondaryMainBrush">#FFF58E0F</SolidColorBrush> <Style TargetType="{x:Type ComboBoxItem}"> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type...

WPF style button

c#,wpf,xaml,styles
I've tried to change style for mouseover event. Here's my styles code: <Window.Resources> <Style x:Key="NavigationButton" TargetType="{x:Type Button}"> <Setter Property="Background" Value="#295fa6"/> <Setter Property="BorderBrush" Value="{x:Null}"/> <Style.Triggers> <Trigger Property="IsMouseOver" Value="True"> <Setter Property="Background" Value="Red"/> <Setter Property="BorderBrush" Value="{x:Null}"/> </Trigger> </Style.Triggers> </Style> </Window.Resources>...

Global style isn't being applied

c#,wpf,xaml,styles
I have a resource dictionary file as so: <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:TIMS.Common"> <local:ViewModelLocator x:Key="ModelLocator" /> <Style x:Key="DefaultWindowStyle" TargetType="Window"> <Setter Property="Background" Value="Cyan" /> </Style> <Style x:Key="DefaultPageStyle" TargetType="Page"> <Setter Property="Background" Value="Red" />...

Style expander header background color in App.xaml

c#,.net,wpf,styles,expander
I'm trying to create a global style for Expander in WPF. This is what I achieved so far: <Style TargetType="Expander"> <Setter Property="HeaderTemplate"> <Setter.Value> <DataTemplate> <Border Background="Red"> <ContentControl Content="{Binding}" /> </Border> </DataTemplate> </Setter.Value> </Setter> </Style> And this is how it looks: Not very satisfying. Question: How can I change the background...

Style “Cannot find resource 'MetroCheckBox'” in MahApps

c#,wpf,xaml,styles,mahapps.metro
I'm starting to use styles in WPF. I'm using MahApps styles as a base, which so far has been really good. I've been able to make specific modifications using the BasedOn property. One of the simpler changes is to add a default margin so when adding controls they don't touch....

Combining style attributes this way

html,css,styles
<!DOCTYPE html> <html> <body> <h1 >This is a heading</h1> <p style="color:blue" "font-size:300%">This is a paragraph.</p> </body> </html> Is it possible to combine two style attributes this way? How does one do that?...

Android - Overriding a Style per Theme

android,styles,android-theme,android-styles
Is there a way to change a style based on what theme is is set on an activity? for example, suppose my activity has a textview with a style set to TextViewStyle <TextView style="@style/TextViewStyle" android:layout_width="fill_parent" android:layout_height="wrap_content" android:text="Text"/> This is my TextViewStyle <style name="TextViewStyle" parent="android:style/Widget.TextView"> <item name="android:textStyle">bold</item> <item name="android:textSize">8sp</item> <item...