Running Local Web Pages in CefSharp.WPF

I needed to create a program which will run a web page from the local file system. Using the WebBrowser control wasn’t really an option since that uses the Trident engine which didn’t support many of the things we were trying to do in the web page. I went with the latest build of CefSharp.Wpf, but that doesn’t natively run local files, so it had to be modified. Fortunately, I found some posts on how to enable that feature (here and here) – however, the first link was for an older version of CefSharp, and the second link only works with static resource files. I ended up merging both concepts to get it to work. ...

January 19, 2017 · 3 min · filip

Extract Formatted Text From Excel Cell With C# (Rich Text Format)

I was writing an application that needed to convert text in a cell in an Excel workbook to HTML. It is fairly trivial to get formatting for the entire cell, but each individual character in the cell could have different formatting itself, so I needed something more specific than cell-level formatting info. At first, I started using the Excel.Range.get_Characters( pos, len ) method to get info out of the cell.  The code would loop through all characters, get them one by one, and check the formatting.  For example: ...

September 17, 2009 · 2 min · filip

Vista Sidebar Gadget, Transparent Backgrounds, and Font Color

We’ve had a request from a client to build a Windows Vista Sidebar Gadget. The background on the gadget is to be somewhat see-through. So I’ve played around with gadgets, and noticed that when I make a semi-transparent background on the gadget, the font color gets all messed up. For example, I wanted white text on a blue background with 50% opacity, and the font appeared blueish, even though it was supposed to be white. If I turn off the opacity on the background, the font becomes white, but as long as there’s opacity, the font is messed up. ...

May 9, 2008 · 1 min · filip