FAQ Database Discussion Community


WPF style info from external text file

wpf,vb.net,styles
Not sure if this is possible, but I have a WPF application that now has a requirement to be skinnable. Basically, this equates to several key colours and a couple of logos. Is there any way of grabbing the hex values for the colours in defined styles from an external...

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

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

Edit Style Attribute of every div in a list

javascript,html,css,styles
I'm trying to write a script to help out a colourblind friend of mine. He's on a page laid out like this: <div class="message-pane-wrapper candy-has-subject"> <ul class="message-pane"> <li><div style="color:#700400"></div></li> <!-- many more li items --> </ul> </div> What I'm trying to do is use JavaScript to change all of the...

ExtJS: displayfield with same style as textfield

css,extjs,styles
I'm using xtype displayfield for fields which act as link and displayfield renders html ok. It works fine. I would like to use a same style for displayfield as for textfield (especially because of border). Could you tell me the simplest way to achieve it? I've tried fieldCls, baseCls etc....

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

Remove Combobox winrt flayout heading

combobox,windows-runtime,styles,winrt-xaml
In winrt windows phone app when you have more than 5 items in a combobox, it opens up on a full screen. And on top its written 'Choose an item'. I want to remove this heading from all my combo boxes....

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

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

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

Attr value is declared in two different libraries

android,design,attributes,styles
I added a library to my project in Android Studio. But as soon as I tried to compile my project I got this error: Attribute barColor has already been declared. After that I checked the whole project and noticed that another library is already declaring that same attribute! How can...

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

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

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?

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

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 use layer-list to create custom background

android,xml,styles
I'm trying to play the background image below using layer-list, but without much success -> http://i.stack.imgur.com/5XBFL.png I used this example <?xml version="1.0" encoding="utf-8"?> <item android:top="1dp" android:left="1dp" android:bottom="5dp" android:right="5dp"> <shape android:shape="rectangle"> <size android:width="20dp" android:height="3dp"/> <solid android:color="#f00"/> </shape> </item> <item android:top="4dp" android:left="1dp" android:bottom="5dp" android:right="5dp">...

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

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

How to delete overlay in an Android modified Holo button?

android,button,styles,overlay,android-theme
I have this style for Buttons in my Android app, but I don't want that little shadow. <style name="AppTheme.Button.Primary" parent="@android:style/Widget.Holo.Button"> <item name="android:background">@color/primary_dark</item> <item name="android:textColor">@color/primary_light</item> <item name="android:gravity">center</item> <item name="android:textSize">15sp</item> <item name="android:layout_width">20dp</item> <item...

Align text in Excel cell with new line c#

c#,excel,styles,interop,excel-interop
How can I align the text in Excel when a cell has 2 lines? I tried this: for (int j = 1; j <= RowsCount; j++) { for (int i = 1; i <= 18; i++) { ws.Cells[j, i].Style.VerticalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; ws.Cells[j, i].Style.HorizontalAlignment = Microsoft.Office.Interop.Excel.XlHAlign.xlHAlignCenter; } } But this works...

How to change the background color of a TextView inside of an ActionMode

android,android-actionbar,styles,android-actionmode
I have a TextView inside of my action bar, like the following: I have logic configured to make it overlay the Toolbar with an ActionMode when I long-press on an item in the associated ListView. This ends up looking like the following: This is basically correct, except for the annoying...

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); }...

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

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

styles css in embeded souncloud player

css,iframe,styles,embed,soundcloud
I am trying to make a small site I use embed code to display soundcloud music in webpage. however, I want to remove the orange button play and the player down my iframe . I am researching I found that I could do it with css, just hidden buttons ....

Any idea with font-size of 1.05em/1.2em?

css,styles,font-size
I saw a vid on Youtube and noticed that the font-size of body is 1.05em/1.2em. http://i.stack.imgur.com/KvWbY.png However, I tried this setting like 1.4em/1em vs. 1.4em. It seems to be a little bigger for 1.4em/1em, but there's no difference between 1.4em/1.4em or things like this. Any idea with this kind of...

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

Scala “Sentence-Like” Function Definition [duplicate]

function,scala,styles
This question already has an answer here: When to use parenthesis in Scala infix notation 4 answers I am refactoring some code and wanted to learn how Scala methods are written so that they can be written like: foo = Map("Hello" -> 1) foo contains "Hello" where "contains" is...

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

WPF: Bind to property of a parent element

c#,wpf,xaml,binding,styles
I'm using a DataGrid and would like to introduce a style trigger for cells that sets the background color of the cell depending on the column's IsReadOnly property. I think there is some way to get from the cell level to the column level using RelativeSource (navigating all the way...

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

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

How change the property of gridslide

jquery,grid,styles,photo,jssor
I changed the property in .js end style but I not have success I need help. The grid is this http://www.jssor.com/demos/grid-slider.html I need it to full screen....