Computing.Net > Forums > Programming > Change the bg color of the document

Change the bg color of the document

Reply to Message Icon

Original Message
Name: go_places_puterwize
Date: July 7, 2008 at 22:12:39 Pacific
Subject: Change the bg color of the document
OS: WinXP
CPU/Ram: P4/512MB
Model/Manufacturer: HP Compaq Presario F
Comment:

I know this may sound a little childish but I am adding a feature to my webbrowser that basically detects a dark background when the page is loading, and will prompt the user if they want to switch to a lighter background color (e.g. low vision)

The detection works just fine, its just I can't get it to actually CHANGE the color without throwing me an error...

here's what I have:
WebBrowser1.Document.BackColor = System.Drawing.ColorTranslator.FromHtml(BrowserOptions.ComboBox1.Text)
WebBrowser1.Document.LinkColor = System.Drawing.ColorTranslator.FromHtml(BrowserOptions.ComboBox2.Text)
WebBrowser1.Document.ActiveLinkColor = System.Drawing.ColorTranslator.FromHtml(BrowserOptions.ComboBox3.Text)
WebBrowser1.Document.VisitedLinkColor = System.Drawing.ColorTranslator.FromHtml(BrowserOptions.ComboBox4.Text)

The color values are HEX (#000000) in the comboboxes.
any suggestions?

Curiousity only injured the cat.
I finished it off..
Muahahaha...


Report Offensive Message For Removal


Response Number 1
Name: Razor2.3
Date: July 10, 2008 at 12:04:40 Pacific
Reply: (edit)

Well, you should probably using ToHtml, as you're plugging it into HTML, and not extracting it.

Also, an error message would be nice. So would source code, as I don't feel like mocking up a browser in VB.NET just to give an answer on an on-line forum.


Report Offensive Follow Up For Removal







Use following form to reply to current message:

   Name: From My Computing.Net Settings
 E-Mail: From My Computing.Net Settings

Subject: Change the bg color of the document

Comments:

 


  Homepage URL (*): 
Homepage Title (*): 
         Image URL: 
 
Data Recovery Software




Have you ever used OpenOffice?

Yes, as my main suite.
Yes, occationally.
Yes, but only once.
No, never.


View Results

Poll Finishes In 5 Days.
Discuss in The Lounge