Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / .NET Framework / Interop / October 2005

Tip: Looking for answers? Try searching our database.

Windows XP themes in a COM Add-in

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Chris - 21 Oct 2005 11:21 GMT
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.


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.