If you follow best practices, you should not be inheriting from Microsoft.SharePoint.WebPartPages.WebPart. According to SDK, "this class exists primarily for the purpose of backward compatibility, and secondarily, to provide a small set of features that are not available in the ASP.NET web part class."
The UseDefaultStyles Property, unfortunately, is available only in the Microsoft.SharePoint.WebPartPages.WebPart class and not in the System.Web.UI.WebControls.WebParts.WebPart class (the class you should really be using 99% of the time).
So...how do I fix my cumbersome SharePoint default CSS for my System.Web.UI.WebControls.WebParts.WebPart inherited class?! This is what I came up with.
public class NoCssWebPart : System.Web.UI.WebControls.WebParts.WebPart
{
protected override void OnInit(EventArgs e)
{
protected override void OnInit(EventArgs e)
{
base.OnInit(e);
// No default styles
if (this.Zone != null && this.Zone.WebPartChrome != null)
{
SPChromeSettings chromeSettings = ((SPChrome)this.Zone.WebPartChrome).GetSPChromeSettings(this);
chromeSettings.UseDefaultStyles = false;
}
}
}