Using ObjectSwap To Avoid Flash/IE Activation Problems

Recently Microsoft lost a lawsuit which required that they not “automatically” enable dynamic content in their browser, or something.

Whatever.  The result is that you now have to CLICK on flash swf files running in your browser before they will be “Activated”.

The way to get around this is to use javascript to do the dirty work. 

Check out this link for a quick include that can help with the work around:

http://www.sitepoint.com/article/activex-activation-issue-ie

 

Printing Vb.Net Forms with PrintForm Component

Microsoft has released their first 3 Power Packs for Visual Basic 2005, which are “free Add-Ins, Controls, Components, and Tools for you to use with Visual Basic 2005 to make developing great applications even easier.”

1 of the first 3 is the Microsoft PrintForm Component 1.0 , which gives you the ability to easily print a form.

I could have really used this on my last project, where I manually wrote the code to do just that.

Make Use Of Culture in SQL Reporting Services Local Reports

When using SQL Reporting services, you can format things such as dates and currency.

However, depending on the situation you might want to:

  1. Show a report with culture X on a computer running culture Y.
  2. Show a report using the same culture settings as the local computer.

To do (1), all you have to do is set the “Language” parameter of the local report in design time.

To get (2) to work, you need to set the Language parameter of the report as the expression “=User.Language”.  This will set the report culture as the culture that the hosting program is running under.

If you have a program that you need to switch between different cultures, you can do so with the following line of code (which changes the culture to “English-Ireland”)

System.Threading.Thread.CurrentThread.CurrentCulture = New Globalization.CultureInfo(“en-IE”, False)

More information can be found at: http://msdn2.microsoft.com/en-us/library/ms156493.aspx

Getting the Access Default Menu Back

I know Access is old news, but I have recently been asked to take a look at an old Access app.

This application replaces the existing menu at the top with a custom one, which really limits what you can do.

The solution to getting the menu back is to right click in the menu area, select customize, highlight “Menu Bar” and select properties, and change “Allow hide/show…” checkbox.  After you do this, you can then add it back into your form.

Default Buttons in ASP.NET 2.0

ASP.NET has this thing where pressing Enter on a page will cause it to be submitted, but no submit action is taken, mostly because you can have multiple buttons on a page, and it isn’t sure which button it should consider clicked when you press enter.

The solution to this was the “__EVENTTYPE” field.  Click here for more info on __EVENTTYPE.

Thankfully ASP.NET 2.0 has introduced some new features to help remove this complexity.

Scott Gu blogs about the new form defaultButton property, as well as the new SetFocusOnError property of the validators here:

http://weblogs.asp.net/scottgu/archive/2005/08/04/421647.aspx

 

Solution to dasBlog "Remember My Login" Not Working

A while ago, maybe 3 months, my blog stopped remembering my login.  When I login I can click to have it remember my login, and thus when I return to the site I don’t have to login every time.

Well I finally arrived at the problem. 

In IIS settings for the website, under the ASP.NET tab, if you click the “Edit Configuration” button, and then the authentication tab, you have the option to set the expiration length for the cookie, which was set to 1 hour.

I changed it to a larger value, restarted the IIS processes, and it appears to be working great now!