Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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 tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Display Modes
  #1 (permalink)  
Old May 29th, 2010, 02:52 PM
Authorized User
 
Join Date: Apr 2006
Location: Dallas, TX, USA.
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.
Reply With Quote
  #2 (permalink)  
Old May 29th, 2010, 04:56 PM
Rod Stephens's Avatar
Wrox Author
Points: 3,141, Level: 23
Points: 3,141, Level: 23 Points: 3,141, Level: 23 Points: 3,141, Level: 23
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2006
Location: , , .
Posts: 640
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!)
Reply With Quote
  #3 (permalink)  
Old May 30th, 2010, 11:25 AM
Authorized User
 
Join Date: Apr 2006
Location: Dallas, TX, USA.
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
Reply With Quote
  #4 (permalink)  
Old June 3rd, 2010, 12:07 PM
Authorized User
 
Join Date: Apr 2006
Location: Dallas, TX, USA.
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
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Change treeview node font-style programmatically panuvin C# 2005 2 December 15th, 2007 01: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



All times are GMT -4. The time now is 11:18 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.