Groups | Blog | Home
all groups > dotnet interop > october 2005 >

dotnet interop : Windows XP themes in a COM Add-in


Chris
10/21/2005 12:00:00 AM
Been trying to get WinXP themes to work in an Office COM Add-in. I came
across this article:

http://support.microsoft.com/default.aspx?scid=kb;en-us;830033

which had a C# example. All good, until I hit the juicy statement at the
end, which makes it all work:


using( new EnableThemingInScope( true ) )
{
Form1 form1 = new Form1();
form1.CreateControl();
}

What does this mean in a VB.NET context? How does it translate, if at all?

Anybody know how to get the WinXP look in a Com add-in, using VB.NET?

Thanks,

Chris.

Mattias Sjögren
10/21/2005 11:26:27 PM

[quoted text, click to view]

Dim scope As IDisposable = New EnableThemingInScope(True)
Try
Dim frm1 As New Form1
frm1.CreateControl()
Finally
If Not (scope Is Nothing) Then
scope.Dispose()
End If
End Try


FWIW, in VB.NET version 8 (or 2005 or whatever) there's a Using
statement added.


Mattias

--
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
AddThis Social Bookmark Button