FAQ Database Discussion Community


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

Coding Style for User defined Exception in java

java,exception,design-patterns,styles
I'm working on a java project. while browsing the existing code of User defined Exception class, i came across a the code written like below: public final class ApplicationException extends RuntimeException { public static void enforce(final String message) { throw new ApplicationException(message); } private ApplicationException(final String message) { super(message); }...

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

How do I convert font style to font weight in Java?

java,fonts,javafx,styles,weight
I want to set a specific ont to a Text within a TextFlow in JavaFx. However, Font has only static .font() methods, which expects a FontWeight instance. How do I convert a font style like "Regular" to a FontWeight instance? There is no "Regular" in the final fields of Font....

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

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

WPF: apply style only to one tabcontrol containing other tabControl

wpf,xaml,styles,tabcontrol
In my wpf application, I have a tabControl (parent) that contains another tabcontrol (child). I would like to apply a style to the tabItem of the parent tabControl without affecting the child one. I tried with this: <TabControl x:Name="Parent" TabStripPlacement="Left" ItemsSource="{Binding Path=ParentTabItems, Mode=OneWay}" > <TabControl.Resources> <Style TargetType="{x:Type TabItem}"> <Setter Property="Template">...

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

Changing styles in Word using vba

styles,word-vba
I am very new to programming, so forgive my ignorance. I am trying to create specific headings in a document that does not have any or has different heading styles assigned. What precedes the text in the headings are numbers. The numbers are specific and essentially represent the content of...

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

VS2013 Form: How can I disable style change on mouseover?

c#,forms,visual-studio-2013,styles
Visual Studio has a mandatory(?) style property 'mouseOverBackColor' that insists on changing the style of a button/checkbox. I would like the button to retain it's current style and ignore mouseEnter/Over/Leave events. Thanks....

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

Indenting text on html select tag

css,css3,cross-browser,styles
I have a select tag which I am trying to give some style. <select class="points-selection" ng-options="line as line.pick for line in slip.lines"> </select> then I have this .points-selection { background-color: get-color(nieve); border: 0; border-radius: get-space(xxx-small); color: get-color(night); cursor: pointer; margin-top: get-space(xxx-small) + 1.5; padding: get-space(xxx-small); text-indent: 32.5%; width: 100%; }...

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

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

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

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

Style div display table-row can be styled or not

html,css,html5,css3,styles
I have a CSS table using divs only, I need to set style to the div ROW like this: <div style="display:table;width:100%;height:80px"> <div style="display:table-row;width:100%;height:80px; background:#333"> <div style="display:table-cell;width:200px;height:auto"> 1 </div> <div style="display:table-cell;width:auto; height:auto"> 2 </div> <div style="display:table-cell;width:200px;height:auto"> 3 </div> </div> more rows and tds in CSS </div> Questions: 1.- because div display...

No Parenthesis in Rails - Good Style? [closed]

ruby-on-rails,ruby,styles
When I first started with ruby/rails and noticed that you don't need to put parenthesis, I recall thinking "no way I'll do that!". But now I kind of like it. So the question is, is that good style? Or should I stick to using parenthesis? Thanks....