Get Blogged by JoKi

"The only frontiers are in your mind"
10 | 03 | 2010
Navigation
Syndication
Most Read Articles
Related Resources
Article Time Line
Visitors
Validation

Valid XHTML 1.0 Transitional
Valid CSS!

Spacer for layout formatting
Working with 'Parameter objects' instead of parameters PDF
User Rating: / 1
PoorBest 
Development
Wednesday, 04 June 2008 11:53

Yesterday I stumbled over a good article in German language - Arbeiten mit Parameterobjekten - about using a parameter object rather than using parameters to pass information to functions and methods. As you know, I like this concept very much and actually already use it since years in my daily work. See also my other article on this: Kommentar zu 'Parameterobjekte'

Well, Tom uses blogger and because I don't have an account there I post my comments here in own 'blog space'. In his article Tom shows some code to transfer the value of the properties of the parameter object to the value properties of controls on the form. Well, I think that this could be way easier using the ControlSource property of the control directly. On the one hand the value is then bound to the parameter object and any changes are directly 'transferred' and on the other hand the concept saves you lots of code. Just configure the ControlSource of each control in the Property Window on the form and you are done. No extra code in Init or Destroy methods necessary.

Text1.ControlSource = Thisform.oParameters.StartDatum


In case of an error change the value of Thisform.BindControls = .F. and one of your last lines in the form Init method is to set the value to .T.


Sincerely, JoKi

 

 
Spacer for layout formatting
About me
Microsoft Most Valuable Professional 2007 & 2008

Microsoft Certified Professional

Get in contact

Follow Jochen Kirstaetter (JoKi) on Twitter JoKi @ ICQ JoKi @ Skype


Recent books

  • MCTS 70-536 - .NET Framework 2.0 Application Development Foundation
  • Code-Centric: T-SQL Programming with Stored Procedures and Triggers
  • Microsoft .NET Framework-Programmierung in C#

Community

deutschsprachige FoxPro User Group

Microsoft Community Leader/Insider Program

International .NET Association

O'Reilly Verlag
Sponsoring
If you like the information on these pages, your support is highly appreciated.
Thank you very much!