styles

Set HTML element's style property in javascript

I have a bunch of old classic ASP pages, many of which show database data in tables. None of the pages have any sorting functionality built in: you are at the mercy of whatever ORDER BY clause the original developer saw fit to use. I'm working on a quick fix to tack on sorting via client-side javascript. I have a script already writte...

WPF: Is it possible to use a converter within a style?

WPF: Is it possible to use a converter within a style? For instance I am trying to create a styled TextBlock whose text resizes based on the ActualHeight property of the TextBlock. The resizing would be don via converter... ...

Binding for WPF Styles

I'm trying to create a custom control - a button - which will have multiple styles applied to it depending on the value of a property within the data context. What I was thinking is using something similar to: <Button Style="{Binding Path=ButtonStyleProperty, Converter={StaticResource styleConverter}}" Text="{Binding Path=TextProp}" />...

How do I change the icon of my Shoes App?

I was wondering if it was possible to change the my Shoes app's icon? I imagine its style-oriented, but I haven't been able to find anything on it. Is this possible? ...

Is it possible to "remove" styling from HTML elements?

I'm wondering if it's possible to restore an element's style to it's "default" state, with Javascript or otherwise. I need to do this because I'm inserting HTML into 3rd party web pages and cannot control what styles they attribute to different elements. For instance, they may have: div { margin: 10px; padding: 5px; line-height:...

ASP.net drop down dynamically styling and then remembering the styles on aborted submit

So, I've got an ASP drop down list (this is .net 2.0). I'm binding it with data. Basically, when the page loads and it's not a post back we'll fetch record data, bind all the drop downs, and set them to their appropriate values (strictly speaking we: initialize page with basic set of data from DB, bind drop downs from DB, fetch actual ...

How do you determine media type in Javascript?

I looked around and didn't see this question asked yet. What's a reliable way in Javascript to determine the media type (e.g. screen, print, handheld) of the page? I've seen references to document.styleSheets[0].media, but I've had no luck using this, either because of browser support issues or because I'm not understanding something. ...

WPF C# - Change the brush of a menu's background

Does anyone know how to change the brush for a menu's background? This sounds simple, but I don't see any obvious way to do this. You'd think that the Background property would change it, but it doesn't. Here's what my menu looks like (notice the default white background): Example Image Example Code: <Window.Resources> <Soli...

In XAML style, how to change solid background to gradient?

I've got a MainResources.xaml file in which I have a style that defines how each of my windows in my application look: <Style x:Key="MainBorderStyle" TargetType="{x:Type Border}"> <Setter Property="Background" Value="WhiteSmoke" /> <Setter Property="BorderBrush" Value="LightGray" /> <Setter Property="BorderThickness" Value...

How to connect Themes/Generic.xaml to window1.xaml?

I have the following button style in Themes/Generic.xaml and I want it to apply to buttons everywhere in my WPF application. How do I connect it to my window1.xaml for instance? <Style TargetType="{x:Type Button}"> <Setter Property="SnapsToDevicePixels" Value="true"/> <Setter Property="OverridesDefaultStyle" Value="true"/> <Sette...

Using cookies and php to change style sheets(CSS).

Hi, I have some code that works and changes the style sheet using a form. That work as long as you keep the browser window open. You can got to a different site come back and the style will be the one you selected, thats fine but if u close the browser and come back it will be set to the default. Is this due to the fact that I am startin...

Declaring Text Decorations such as Underline, Strikethrough in a Style.

How do I include text decorations such as Underline, Strikethrough etc in a Style definition: <Style x:Key="UnderlinedLabel"> <Setter Property="Control.FontFamily" Value="Trebuchet MS" /> <Setter Property="Control.FontSize" Value="14" /> <!-- Next line fails --> <Setter Property="Control.TextDecorations" Value="Under...

Styling an input type="file" button

How to style the input type="file" button. ...

Now that I've set up Forms Authentication on my site, the stylesheet won't load!

I've set up Forms Authentication on my ASP.NET MVC website, including setting up appropriate entries in the web.config. Now every request to my site redirects to the Login page to authenticate the user. Problem is, this happens even when my pages try to access the master stylesheet (in the Content folder), so they end up rendering with...

WPF/XAML Style set Property for child items?

Hello, I working on a XAML style for my controls. The code below is for setting the color of a stackpanel. It works fine but there is something else I want to do. If the trigger is activated I want to set the font color for all child items inside the stackpanel. At the moment I only have textblocks inside the stackpanel and I know I co...

Reuse built-in WPF styles

How can you access WPF's built-in styles/templates? For example I'm trying to move the NavigationWindow's chrome to the bottom of the window. I've seen Microsoft's NavigationWindow template example but it is quite verbose and doesn't reuse the default navigation chrome. I've also tried looking at the tree inside Snoop. All the chrome ...

Using Django admin look and feel in my own application

I like the very simple but still really elegant look and feel of the django admin and I was wondering if there is a way to apply it to my own application. (I think that I've read something like that somewhere, but now I cannot find the page again.) (edited: what I am looking for is a way to do it automatically by extending templates, i...

Styling nested elements in WPF

Suppose you have a nested element structure, for example a ContextMenu with MenuItems: <ContextMenu Style="{StaticResource FooMenuStyle}"> <MenuItem Style="{StaticResource FooMenuItemStyle}"/> ... </ContextMenu> You can easily apply styles or templates to the ContextMenu or MenuItem elements. But if the MenuItem style belongs ...

WPF: Applying styles throught the application

In WPF, where can I put styles that should be applied throughout the application? This is because currently, whenever I use a style, I put it in the <Window.Resources> section of every window, which ofcourse is wrong in so many ways. So where can I put these styles to apply throughout? ...

App Crashes when changing tabs that contain listboxes with control templates on ItemContainerStyle and bound to CollectionViewSource

Hi, my problem is that i have three tab controls each with a listbox that has style for both the ListBox and the ItemContainerStyle, the styles are the same on all listboxes inside the tabs. two of the tabs are databound using a CollectionViewSource. The problem is as soon as i try to go into tab 2 i get an exception and i cant seem to...