style

javascript style.width not working in firefox with transitional doctype

I have a script that animates a small DIV popping up on the page. It all works fine in IE, and in FF if I remove the DOCTYPE, but when the DOCTYPE is XHTML/Transitional, in Firefox, the width does not change. this.container.style.visibility = "visible"; alert("this.container.style.width before = " + this.container.style.width) this.con...

WPF Xaml Custom Styling Selected Item Style in a ListBox

I have a list box that scrolls images horizontally. I have the following XAML I used blend to create it. It originally had a x:Key on the Style TaregetType line, MSDN said to remove it, as I was getting errors on that. Now I'm getting this error: Error 3 Operation is not valid while ItemsSource is in use. Access and modify elements w...

How to set WPF's Grid.RowDefinitions via Style

Hi! I'm using a couple of Grids to format multiple GridViewColumn.CellTemplates: <ListView SharedSizeScope="true"> <ListView.View> <GridView> <GridViewColumn> <GridViewColumn.CellTemplate> <DataTemplate> <Grid> <Grid.RowDefinitions> <RowDefinition SharedSizeGroup="...

Is there an alternative to hyper-indented code?

I often run into code that has to perform lots of checks and ends up being indented at least five or six levels before really doing anything. I am wondering what alternatives exist. Below I've posted an example of what I'm talking about (which isn't actual production code, just something I came up with off the top of my head). public ...

"C" sizeof with a type or variable

Recently saw someone commending another user on their use of sizeof var instead of sizeof(type). I always thought that was just a style choice. Is there any significant difference? As an example, the lines with f and ff were considered better than the lines with g and gg: typedef struct _foo {} foo; foo *f = malloc(count * sizeof f);...

CSS Selector Style

Simple question, and probably reflects my inexperience with CSS, but... When creating a style sheet I like to explicitly specify the '*' wild card, so: *.TitleText { instead of just .TitleText { I find it reminds me that TitleText is applied to "any" tag, and can be overridden by a subsequent h1.TitleText. Maybe I just like this ...

Easiest way to ensure same font and font size in labels, input boxes and text areas

I have a page where I combine labels, input boxes and text areas to display some content. I would like all of them to have the same font-family and font-size. I have played with the font-family: inherit style but this doesn't seem to work for the input and text areas. What would be the easiest way to ensure the same font / size over the...

Can the CheckStyle module "NeedBraces" work with nested if/else blocks?

We are using CheckStyle to enforce our style standards. One of the style rules we opted to include was the NeedBraces module. NeedBraces specifies that every block type statement (such as if, else, for) must have opening and closing curly braces. However, as far as I can tell it isn't working entirely correctly. This example will tri...

Applying a single style to multiple controls (and tweaking each style)

Hi all, I have a WPF application that is using a custom style. In it I have a set of buttons that each have a custom background image. For each button, I'm supplying a normal and a mouse down image. Is there a simple way to do this with a single style (and customize each button on a case by case basis)? Currently I'm creating a ne...

Is there a CheckStyle rule to force if else keywords to be on the same line in an if/else ladder?

Based on this question it appears that the default template for CheckStyle will allow if else ladders to separate the if and else with a line break. Meaning I would like this code to be flagged as a violation: if (true) { System.out.println("20"); } else if (true) { System.out.println("30"); } Is there a Ch...

Using return statements to great effect!

When I am making methods with return values, I usually try and set things up so that there is never a case when the method is called in such a way that it would have to return some default value. When I started I would often write methods that did something, and would either return what they did or, if they failed to do anything, would r...

DataBound WPF ListBox Styling on ListBoxItems

I have a listbox that during development I had the items in the list box hardcoded and styled. This is how the items were styled. <ComboBoxItem Width="Auto" Height="Auto" Content="ComboBoxItem" > <ComboBoxItem.Foreground> <LinearGradientBrush EndPoint="0.5,1" StartPoint="0.5,0"...

How do I completely replace the content of a WPF button with a graphic path?

I've deconstructed a standard WPF button using Blend and have managed to create a nicely styled button, but I cannot figure out how to make the path fill the interior of the button space (the button width and height). I am also not sure if I need to specify ContentPresenter or even if it is correct. I am after the text in the middle of t...

How can you change the highlighted text color for a WPF TextBox?

The WPF TextBox natively makes use of the System Highlight color for painting the background of selected text. I would like to override this and make it consistent since it varies by OS/user theme. For ListBoxItems, there is a neat trick (see below) where you can override the resource key for the HighlightBrushKey to customize the Syst...

CSS Performance issues

hi, What are the aspects of style sheets (CSS) that can lead to poor performance of web sites? Anything that can really choke up the CPU? thanks in advance. Sesh ...

How to set default WPF Window Style in app.xaml?

Hi, I am trying to set the default Style for every window in my WPF Windows application in my app.xaml. So far i have this in app.xaml: <Application.Resources> <ResourceDictionary> <Style x:Key="WindowStyle" TargetType="{x:Type Window}"> <Setter Property="Background" Value="Blue" /> </Style> </Resourc...

Set Navigationbar (barstyle) color when more page

Hi, I use One tababrController And Several navaigation Controller to display I set barstyle And tint of each navigationBar From IB(Xib) I Also Try To set it from Each of their Own Class File Its Work But When I open it form more tabbar it have default barstyle I try Thanks a lot in advance I know its easy bt i m new to i-phone o...

Erlang: doing a good job

I've done a bit of functional programming, and I have a couple online references, so I'm finding basic Erlang programming pretty easy. But since I've done far more procedural/object-oriented programming than functional programming, I expect my Erlang code isn't very well styled or efficient. Can anybody recommend any resources that cov...

Place Radio Button Label Above Using CSS

I need the ability to place the labels for radio buttons above the selections, and not to the left or the right. Is there a way to use CSS that would give this effect? THanks! ...

What is the best way to style alternating rows in a table?

Obviously, the actual style of the odd/even rows will be done via a CSS class, but what is the best way to "attach" the class to the rows? Is is better to put it in the markup, or is it better to do it via client-side javascript? Which is better and why? For simplicity's sake, lets assume that this is a large table, 100 rows, and that ...