FAQ Database Discussion Community


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...

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...

Choose Style depending on property

c#,wpf,styles,datatrigger
Is it possible to set the Style Property (of a Button for example) from within a DataTrigger on the same control? I would like to define my Default-, MouseOver- and Selected-Styles as resources to reuse them later on. However handling MouseOver (and other) events seems to be usually done by...

How to change window style/theme in c++

c++,user-interface,styles,window,themes
I need an approach how to customize the window style like Steam or Spotify. I don't want to have the boring Windows (or any other OS) look. Can that be done with Qt or the WinApi? Do I need DirectX or OpenGL for doing that? Best Regards...

Applying some styles to control

java,android,xml,styles
As you know in html/css you may apply some classes (and hence some styles) to the tag. It is cery convenient and i would like to have tgis opportunity in android development. Is there a way to apply some styles to one control?

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...

“Use Theme.AppCompat theme with this activity” Exception

android,android-actionbar,styles,themes
I used recently Android Asset Studio to generate a custom Action bar theme for an app and when I placed everything in my project the app crashes with this exception: "java.lang.IllegalStateException: You need to use a Theme.AppCompat theme (or descendant) with this activity." Please if somebody has an idea why...

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....

Change icon on ActionBar tab click or swipe - Android

android,android-layout,android-actionbar,styles,android-tabs
It took me a long time just to get my ActionBar tab icons in the split ActionBar, as well as get the tab indicator color to white. So now all I need to do is to swap the icon with a different color, when it is unselected. The selected icon...

CSS background elements on both sides of the screen

html,css,background,styles
I want to achieve this: two decoration elements (sort of waves) on both sides of the screen. Here's what I've got so far. If more elegant solution is possible (like styling with CSS only body element), then please advise. Below solution would be fine, if both < img > elements...

Define common styles in android drawables

android,styles,drawable
I am trying to style a list item in android. I am using the following xml drawable: <?xml version="1.0" encoding="utf-8"?> <selector xmlns:android="http://schemas.android.com/apk/res/android"> <item android:state_pressed="true"> <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item> <shape android:shape="rectangle"> <solid android:color="#882980b9"></solid> <corners android:radius="@dimen/margin"></corners> </shape> </item> <item...

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>...

jquery: how to determine if a style is set via css class or hardcoded by style attribute? [duplicate]

jquery,css,styles
This question already has an answer here: jQuery check if element has a specific style property defined inline 4 answers For example given two divs like this: .example{ width: 200px; height: 200px; z-index: 4; } <div id="first" style="height:100px;width:200px;z-index:5;">Hardcoded</div> <div id="second" class="example" >Css</div> How can i detect by jquery/javascript if,...

How do I apply CSS style to ASCII character

html,css,styles,ascii,weight
I'd like to reduce the weight of a my ascii degree character &deg; in my html document. Does anybody know how? HTML: <html> <body> <table> <tr> <td> <div style="position:absolute; top: 70; right: 0;"> 72 <span>&deg;</span> F </div> </td> </tr> </table> </body> </html> CSS: body { height: 100%; font-weight: 400; color:...

How to make both ListViewItem's template style and ListView.ItemTemplate working?

wpf,xaml,listview,styles
I have the code below in my App.xaml. I override the template to make the background stays the same as transparent when I click/hover on a ListViewItem. <Style TargetType="{x:Type ListViewItem}"> <Setter Property="Background" Value="Transparent" /> <Setter Property="Height" Value="{StaticResource RowHeight}"/> <Setter Property="Template"> <Setter.Value> <ControlTemplate TargetType="{x:Type ListViewItem}"> <Border BorderBrush="Transparent" BorderThickness="0" Background="{TemplateBinding Background}">...

jTextPane color with some exception in chat

java,swing,styles,chat,jtextpane
I am using jTextPane to use sender and receiver chat color. All works fine but [email protected] every chat message. here Jhon is revceiver and peter is sender here peter is revceiver and Jhon is sender may be I m doing some mistake in code. Here is the code for Sender...

How to change ActionBar menu background color (android 4 & 5)

android,menu,android-actionbar,styles,background-color
I've got one trouble while changing android design. I need to change action bar menu background color to black. I know, there are lots of answers for this question. I tried many of them. But nothing worked for me. Oh, and i forgot to say, that i am not a...

JS: Cannot read property 'style' of null

javascript,styles
(Sorry for my aplogize, I got some mistake, just updated the new code again.) I have the following code,and Chome throws"Uncaught TypeError: Cannot read property 'style' of null" to the console: function gen_mainTable(){ var code = ""; code +='<table width="100%" border="1" cellspacing="0" cellpadding="4" align="center" class="FormTable_table" id="mainTable_table">'; code +='<tr><td class="CL">SELECT</td><br><td colspan="2"...

How to style object when the user clicks it

html,css,styles
In css for the links I can style the as before user clicks and after user clicks. But how can I do this for simple text or an object that when a user clicks that object then change its color. For Example <style> .object:onmouseclick { background-color:green; padding:5px; } </style> What...

Unexpected behavior of AlternativeRow BackColor in WPF

c#,wpf,datagrid,styles
I'm styling my DataGrid using an style provided by Microsoft at this page. I'm not changing this style except a single line as following that enables alternative row back color. <!--Style and template for the DataGrid.--> <Style TargetType="{x:Type DataGrid}"> <Setter Property="AlternationCount" Value="2"/> ... and the rest of the style I...

CSS - Adding background images in the body of a website not working.

html,css,website,styles,background-image
Here I have some css styles that alter the layout of all webpages for my website, with a wrapper that is 900px wide a header and the main body. So far I've changed the background colour in the body section which works great. However if I add some code to...

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 style Bootstrap menu like a V? [closed]

css,twitter-bootstrap,menu,styles
Is it possible to style the menu like this (see link http://i.stack.imgur.com/Z5YB6.jpg) in Bootstrap using CSS? How to I do? Thank you in advance!...

How to position checkbox and text

jquery,html,css,checkbox,styles
I'm having some trouble positioning these checkboxes with its respective text. The actual checkboxes were hidden so that a personal style could be used. Anyway, this is purely a CSS issue. The text should be positioned in front of the checkboxes. I've been banging my head against the wall and...

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">...

Multiple white space in html

html,styles,whitespace
I would like to ensure that my chords above words are separated nicely by multiple white space. The issue is that when I use pre, it comes out pre-formatted and hence not what I wanted. Also, with &nbsp;, the code looks very ugly. What is the best method to solve...

item radius shape android

android,xml,styles
Sorry for my English. I can not understand the work with of radius. I need to create a transparent figure in which to store the text. Below I have created a figure, but rounded corners at the top-left corner does not work <layer-list xmlns:android="http://schemas.android.com/apk/res/android"> <item android:top="-1dp" android:right="-1dp" android:left="-1dp" android:bottom="-1dp"> <shape>...

WPF: why my slider not show the minimum value on my label

wpf,slider,styles
<Grid Margin="405,192,170,450" > <Slider Name="speedSlider" Value="1" Style="{StaticResource SliderStyle}" HorizontalAlignment="Left" VerticalAlignment="Bottom" Minimum="0" Maximum=" 50" TickFrequency="5" TickPlacement="None" Width="160"/> <Label Name="lblSliderSpeed" Content="{Binding ElementName=speedSlider, Path=Value, UpdateSourceTrigger=PropertyChanged}" Grid.Column="1" VerticalAlignment="Bottom" HorizontalAlignment="Right" ContentStringFormat="{}{0:#}"/> </Grid> My label show the current slide...

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...

Jssor slider variable width based on window width

css,slider,styles,width,jssor
It is possible to change slides to fixed width based on window size (media queries)? I don't want it to scale or be in percetange, just fixed width depending on window size. For example something like this @media screen and (min-width: 320px) { .slides { width: 200px; } } @media...

DataGridView freezes when loading content and style C#

c#,winforms,datagridview,styles,freeze
My form has 6 dataGridViews in different tabs of a tab Control, the user is able to enter values and change the cell backcolor, with a save button, the values for each dataGridView are saved into a text file, same with the backcolor of the cells in each dataGridView. When...

Is it possible to add a class and a style to a Razor element

css,razor,model-view-controller,styles
Is it possbile to add a style AND a class atrribute to a Razor element. <div style="width:170px;float:left;"> @Html.DropDownListFor(m => m.SelectedPremise, Model.PremiseList, "Please select", new { @class = "selectpicker", data_style="btn-primary" ,style="width:100px;"}) </div> This does not work......

Why font-size is not applied to raw cell content

html,css,styles
I have class definition: .small, td.small, td.small > nobr, td.small > a { font-size: 90%; } That makes text inside of anchor in the cell looking smaller. But style is not applied if I put text in cell without anchor. <table> <tbody> <tr> <td class="small"> <a href="...">Small content</a> </td> <td>Should...

HTML email coding

html,email,styles
I am altering an html email template created by previous designer. It doesn't look right to me: <html style="margin: 0;padding: 0;border: 0;width: 100%;height: 100%;"> <head> </head> <style type="text/css"> I would have thought 'style' goes into 'head' and 'html style="..." looks confusing. I am not an expert on html emails, just...

Android - Send email with styled HTML

android,html,colors,styles
I get a server response which provides us with HTML to be sent via gmail. This works fine on the iOS counterpart of the app, however the text just comes out as plain text in the Android application. Here is an example part of the response we get: <html> <p...

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>...