The Problem Solver

Tell me and I will forget
Show me and I will remember
Involve me and I will understand
- Confucius -

Google Ads

This Blog

Syndication

Search

Tags

News





  • View Maurice De Beijer's profile on LinkedIn

Community

Email Notifications

Explore

Archives

Building Windows Presentation Foundation applications in Visual Basic 2008

Setting Option Strict Off can be a very useful thing in Visual Basic but having project template depend on it being this way certainly isn't a good thing Sad

Unfortunately this is the case with the WPF project template for VB and the result could be a compile error in a new project depending on your default setting of Option Strict. Not a big deal as the error is easy to correct but still a bit of a nuisance. Fortunately the error isn't hard to correct and requires only a single code change. Find the line of code with the error, this should be:

Return Global.System.Windows.Application.Current

And add a type cast to is like this:

Return CType(Global.System.Windows.Application.Current, Application)

And you should be ready to go. The best place to make this change is in the project template so you only have to do this once. The steps required, and more information, can be found here http://support.microsoft.com/kb/945756

Enjoy!

Published Tue, Dec 11 2007 8:39 by Maurice
Filed under: , , ,

Comments

# Cjzunvvi@ Monday, July 13, 2009 10:36 AM

JGCJqm

# Kntazion@ Monday, July 13, 2009 10:36 AM

HaT0sp

# Cntdaiku@ Monday, July 13, 2009 11:36 AM

iYeoSe

# Ctmalezt@ Monday, July 13, 2009 12:26 PM

gTHni0

# Uutqeugu@ Monday, July 13, 2009 12:26 PM

mCPbFi

# Bbzkhdyd@ Monday, July 13, 2009 2:27 PM

WqgStM