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 - 21 Oct 2005 22:26 GMT
>What does this mean in a VB.NET context? How does it translate, if at all?
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

Signature
Mattias Sjögren [MVP] mattias @ mvps.org
http://www.msjogren.net/dotnet/ | http://www.dotnetinterop.com
Please reply only to the newsgroup.