A New Internet Library: Add Your Website/Blog or Suggest A Website/Blog to our Free Web Directory http://anil.myfunda.net.

Its very simple, free and SEO Friendly.
Submit Now....

Wednesday, December 17, 2008

Always run WPF App in Maximized View

I have been playing around with WPF Applications and one of the annoying things about WPF as well as Windows Forms is that they always open up in a Normal View (which is like a Restored View) and you have to maximize it to have a full view of your application. I know this is a simple setting right from the VB Days and was wondering where to set it up in case of WPF.

The solution was to just to add the following line of code under the "InitializeComponent()" call in your Window1.xaml.cs or whatever is the startup Window.

      InitializeComponent();

      this.WindowState = WindowState.Maximized;

I am sure there are different ways to achieve this and it can be set at the configuration level etc., But this post is just for simply doing it quickly.  

If there are caveats, best practices, please post in the comments..

Cheers !!!



Source Click Here.

No comments:

Post a Comment

Post your comments here:

Originals Enjoy