Kevin McNeish Blog

All things iOS, Kindle and .NET

Recent Posts

Tags

News

  • First books in my new book series, "iOS App Development for Non-Programmers" are now available! iBookStore: http://itunes.apple.com/us/book/book-1-diving-in-ios-app-development/id558788074?mt=11 Amazon: http://www.amazon.com/dp/B0097N8XBE Amazon: http://www.amazon.com/dp/B0099RQGMQ

Community

Email Notifications

Archives

WPF: Setting the Height or Width to Auto in Code

At times, you may want to programmatically set the Height or Width of a WPF element to Auto in code. To do this, just use the Double.NaN (Not a Number) value.

For example, in C#:

this.txtName.Width = Double.NaN;

And in VB .NET:

Me.txtName.Width = Double.Nan

Best Regards,
Kevin McNeish
INETA Speaker
Chief Architect, MM .NET Application Framework
www.oakleafsd.com

 

 

Comments

Jim said:

Thank you!

# June 28, 2011 6:25 AM

Cesar said:

Thanks

# August 20, 2013 8:06 AM
Leave a Comment

(required) 

(required) 

(optional)
 

(required) 

If you can't read this number refresh your screen
Enter the numbers above: