styles

How to apply multiple styles in WPF

In WPF, how would I apply multiple styles to a FrameworkElement? For instance, I have a control which already has a style. I also have a separate style which I would like to add to it without blowing away the first one. The styles have different TargetTypes, so I can't just extend one with the other. ...

Should I *always* favour implictly typed local variables in C# 3.0?

Resharper certainly thinks so, and out of the box it will nag you to convert Dooberry dooberry = new Dooberry(); to var dooberry = new Dooberry(); Is that really considered the best style? ...

How do I style (css) radio buttons and labels?

Given the code bellow, how do I style the radio buttons to be next to the labels and style the label of the selected radio button differently than the other labels? <div class="input radio"> <fieldset> <legend>What color is the sky?</legend> <input type="hidden" name="color" value="" id="SubmitQuestion" /> <...

Spartan Programming

I really enjoyed Jeff's post on Spartan Programming. I agree that code like that is a joy to read. Unfortunately, I'm not so sure it would necessarily be a joy to work with. For years I have read about and adhered to the "one-expression-per-line" practice. I have fought the good fight and held my ground when many programming books count...

How do I make custom MenuHeaders in WPF with accelerators?

I'd like to make some custom MenuHeaders in WPF so I can have (for example), an icon and text in a menu item. Normally using MenuItems, if you populate the Header field with straight text, you can add an accelerator by using an underscore. eg, _File However, if I wanted to put in a UserControl, I believe this function would break, how ...

ASP.NET Custom Control Styling

Hi There. I am in the process of beginning work on several ASP.NET custom controls. I was wondering if I could get some input on your guys/girls thoughts on how you apply styling to your controls. I would rather push it so CSS, so for the few controls I have done in the past, I have simply stuck a string property which allows you so ty...

SSRS 2005 Matrix and border styles when exporting to XLS

The Matrix in SSRS (SQL Server Reporting Services 2005) seems to have issues with certain the border styles when exporting to XLS (but not PDF or web view; maybe other formats, not sure?). For example: Create a matrix and set the Matrix border style to Black Solid 1px, but all 4 of the cells to have a border style of Black None 1px. Whe...

What is the easiest or fastest way to make CSS render the same in all browsers

Making a web page display correctly im all major browsers today is a very time consuming task. Is there a easy way to make a CSS style that looks identical in every browser? Or at least do you have some tips to make this work easier? ...

Latex styles - what do you use and where to find them

What Latex styles do you use and where do you find them? The reason I'm asking this is that it seems that some 99.9999% of all styles on the internet are copies of each other and of a physics exam paper However, when you try to find a style for a paper like this one... Good luck, you are never going to find it. Creating your own style...

External Styles in JasperReports

Hi there, I'm working on a system that includes a large number of reports, generated using JasperReports. One of the newer features is that you can define styles for reports. From the available docs I believe there is some way to have an external file defining styles to use, and you can reference that in your jasper reports. This allow...

How do you display styles in a HTML textarea

I am trying to add different styles within a textarea eg bold, different colors etc WYSIWYG editors (eg tinyMCE) used in web pages typically do this but I am having trouble working out how they do it. You cannot do this: So how do they achieve it? ...

Style for web application grid

Hi, I'm working on a small bugtracking system which shows a list of bugs. For the overview I want to use a grid - now I only need a style. Of course I won't copy the whole style from anyone else, but I just want to know which type of styles you like. Do you have any other great style? What do you think about the styles on this site. ...

WS_VSCROLL, CreateWindow style works, SetWindowLong doesnt

When i do wnd = CreateWindow("EDIT", 0, WS_CHILD | WS_VISIBLE | WS_VSCROLL | WS_HSCROLL | ES_MULTILINE | ES_AUTOVSCROLL | ES_AUTOHSCROLL | ES_WANTRETURN, x, y, w, h, parentWnd, NULL, NULL, NULL); everything is fine, however if i remove the WS_VSCROLL and WS_HSCROLL then do the below, i do not get them thus have i...

WPF: Adding a Trigger to a Button

I am currently coding a program with a WPF UI and I have a button which is either close or cancel, depending on if there were any changes made on the page. To achieve this I want to use a trigger (wrapped in a style) on the button so that when the dependency property HasChanges is true the button will change from "Close" to "Cancel". S...

Silly and frustrating cross browser UI issues

Has anyone spent several hours to get the UI of their application render correctly in all the browsers? How do you tackle the frustration when simple styles tend to work in one browser but not others..and end of the day you invent the hack to handle it (in some cases that too does not happen), only after wasting your time? I will wait ...

Can you do "math" within WPF Styles that are data-bound

I have a button control style and I want to change the padding from whatever the data-bound version is to adjust for a glyph that needs a 2 pixel offset. I'll use SimpleButton from SimpleStyles.xaml as an example (... shows where the trigger code was removed for conciseness): <Style x:Key="SimpleButton" TargetType="{x:Type Button}" Bas...

Can you databind to CornerRadius via WPF Styles?

I have a Button style and can't seem to property databind the border's CornerRadius property to the template. This is a dependency property, so it should be data bindable. I wonder if I'm missing the right XAML syntax to use? <Style TargetType="{x:Type Button}" BasedOn="{x:Null}"> <Setter Property="FocusVisualStyle" Value=...

Is there a way to disable/override the default style for disabled WebControls

Hi there, that one has been nagging me ever since I dabbled in web developpement; is there a way for this? Could I override that style and rely on some other mean to inform my users that that control can't be ineracted with? My problem is that the graying of RadioButton- and CheckBox-Lists' labels makes them unreadable. I could alway...

How do I determine at runtime whether the style applied to an object is the default style?

I want to be able to apply a style at runtime to an object ONLY if the current style is the default style. I don't want to override any user defined styles. Anyone know how to do this? ...

What is the best approach for applying styles to massive amounts of items?

In my LOB apps I usually wind up with containers that contain a bunch of different textblocks and textboxes for users to enter data. Normally I need to apply a certain margin or vertical/horizontal alignment to each control. Let's say I have Grid on my form that looks like this (a lot of markup was eliminated for brevity): <Grid> <G...