PC Review


Reply
Thread Tools Rate Thread

Clearing styles

 
 
tshad
Guest
Posts: n/a
 
      5th May 2009
In 3.5 you can add styles like so:

MessageLabel.Style.Add("color", "Red");
MessageLabel.Style.Add("font-weight", "Bold");

But there is a Clear method as well - but I called it like so:

MessageLabel.Style.Clear();

But it still displayed Red and Bold.

Doesn't Clear() clear the styles?

Thanks,

Tom


 
Reply With Quote
 
 
 
 
Pavel Minaev
Guest
Posts: n/a
 
      5th May 2009
On May 4, 4:54*pm, "tshad" <t...@pdsa.com> wrote:
> In 3.5 you can add styles like so:
>
> MessageLabel.Style.Add("color", "Red");
> MessageLabel.Style.Add("font-weight", "Bold");
>
> But there is a Clear method as well - but I called it like so:
>
> MessageLabel.Style.Clear();
>
> But it still displayed Red and Bold.
>
> Doesn't Clear() clear the styles?


By the context, it seems that you're referring to ASP.NET, and
WebControl.Style. If so, then clearing should work, but it's hard to
say much without seeing the actual code that exhibits the problem.
Maybe you're clearing it too early or too late in the page lifecycle,
maybe there's something else.
 
Reply With Quote
 
Cor Ligthert[MVP]
Guest
Posts: n/a
 
      5th May 2009
Thad,

I have the same problem with your message like Pete and Pavel.

However, with styles it is always that as a style on a lower part is
cleared, the style from a higher part becomes active.

Cor

"tshad" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> In 3.5 you can add styles like so:
>
> MessageLabel.Style.Add("color", "Red");
> MessageLabel.Style.Add("font-weight", "Bold");
>
> But there is a Clear method as well - but I called it like so:
>
> MessageLabel.Style.Clear();
>
> But it still displayed Red and Bold.
>
> Doesn't Clear() clear the styles?
>
> Thanks,
>
> Tom
>
>


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Restoring original Normal and No spacing styles in styles gallery Stefan Blom Microsoft Word Document Management 0 21st Aug 2009 06:40 PM
Word 2007 styles - Styles pane - "Disable Linked Styles" rgille Microsoft Word Document Management 5 3rd Jul 2008 03:31 AM
Make Word Outlining use bullet styles instead of heading styles? =?Utf-8?B?Qm9iVw==?= Microsoft Word Document Management 1 13th Apr 2006 05:21 PM
BUG in Word 2003: Styles Organiser won't copy Styles with spaces =?Utf-8?B?UmljayBSYXViZW5oZWltZXI=?= Microsoft Word Document Management 2 31st Mar 2005 02:57 PM
Formatting text with styles: problem with default Word97 styles jk Microsoft Word Document Management 1 29th Aug 2003 02:47 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:09 PM.