Wrox Programmer Forums
|
BOOK: WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4
This is the forum to discuss the Wrox book WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 by ; ISBN: 9780470477229
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: WPF Programmer's Reference: Windows Presentation Foundation with C# 2010 and .NET 4 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 29th, 2010, 02:52 PM
Authorized User
 
Join Date: Apr 2006
Posts: 17
Thanks: 2
Thanked 0 Times in 0 Posts
Default Change TextBox properties programmatically

Hi,

I'm very new to WPF. I hope you can be patient with me as I try to learn it.

You can download my code here: http://www.4shared.com/file/VmO8otFV...mer_v_100.html. (You should not have to download the 4shared Desktop app.)

I'd like to programmatically change properties of a TextBox in C# (Visual Studio 2010 and .NET 4.0). See lines 114 & 115. I get compile errors. I'm sure it's because I don't fully understand WPF. I'd really appreciate a brief tutorial or a link to a video tutorial.

Thanks!
__________________
Sam Stamport

Last edited by perstam; May 29th, 2010 at 02:57 PM..
 
Old May 29th, 2010, 04:56 PM
Rod Stephens's Avatar
Wrox Author
 
Join Date: Jan 2006
Posts: 647
Thanks: 2
Thanked 96 Times in 95 Posts
Default

I think the problem is that this code is in the InputData class not the Window1 class. The Window1 class is the one that holds the TextBoxes so InputData doesn't know anything about them.

Somehow you need to either give the InputData object access to the TextBoxes or make the Window1 object handle this.
__________________
Rod

Rod Stephens, Microsoft MVP

Essential Algorithms: A Practical Approach to Computer Algorithms

(Please post reviews at Amazon or wherever you shop!)
 
Old May 30th, 2010, 11:25 AM
Authorized User
 
Join Date: Apr 2006
Posts: 17
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Yep. That was my guess too.

Question is: How to give the InputData object access to the TextBoxes or make the Window1 object handle it.

I wonder if inheritance is the solution. Could Window1 inherit from InputData or vice versa?
__________________
Sam Stamport
 
Old June 3rd, 2010, 12:07 PM
Authorized User
 
Join Date: Apr 2006
Posts: 17
Thanks: 2
Thanked 0 Times in 0 Posts
Default

Solutions to this problem:

How to access validation class properties from standard events (Window1)
http://social.msdn.microsoft.com/For...-a721d4a2cbe6/
How to access widget properties from validation class:
http://social.msdn.microsoft.com/For...1-6aa1d6bfc6fc
__________________
Sam Stamport





Similar Threads
Thread Thread Starter Forum Replies Last Post
Change treeview node font-style programmatically panuvin C# 2005 2 December 15th, 2007 02:59 AM
change programmatically color of a detailsview hertendreef ASP.NET 2.0 Professional 3 June 22nd, 2006 01:34 PM
Change the properties of a textbox control? marksartwork ASP.NET 1.0 and 1.1 Basics 7 April 4th, 2006 04:55 PM
Programmatically Change Printer Settings vempativenu Beginning VB 6 0 September 2nd, 2004 06:29 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.