Kevin
Tue May 01 13:09:03 CDT 2007
> Take the options dialog box in word, there are litterally hundreds of
> options to choose from. If I chance the dictionary from English to
> Spanish, the Apply button magically enables itself. It knows changes
> have been made and that the options need to be saved.
What makes you think that the localization properties of a Word document are
not properties of the Word document? All the interface does is change the
property of the document. The document object then sets its' "Dirty"
property to true.
--
HTH,
Kevin Spencer
Microsoft MVP
Printing Components, Email Components,
FTP Client Classes, Enhanced Data Controls, much more.
DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
"Sir Psycho" <panuccio.vince@gmail.com> wrote in message
news:1178032458.616089.178590@u30g2000hsc.googlegroups.com...
>I know what you mean Kevin, however your assuming all applications are
> like Word :)
>
> Take the options dialog box in word, there are litterally hundreds of
> options to choose from. If I chance the dictionary from English to
> Spanish, the Apply button magically enables itself. It knows changes
> have been made and that the options need to be saved.
>
> I think the solution may a combination of Stoitchos idea, too loop
> through all the controls on a form and to inherit the existing winform
> controls and add a dirty property to each one. This would save me a
> lot of coding and i could loop through each one.
>
> Thanks for your thoughts :-)
>
>
>
>
> On Apr 26, 12:01 am, "Kevin Spencer" <unclechut...@nothinks.com>
> wrote:
>> You're not thinking fourth-dimensionally!
>>
>> A Control is never edited. A Control is a user interface element which
>> connects the user to the application. For example, in Microsoft Word,
>> there
>> are literally thousands of Controls. But there is only one Document. Word
>> tracks the Document, not the Controls, to determine whether the Document
>> is
>> "dirty" (needs saving) or not. So, assuming that your application allows
>> users to change some object, all you need to do is keep track of changes
>> to
>> the object. This may involve creating a class that provides a programming
>> interface to the object, and having the class implement a "dirty" value
>> when
>> it makes changes to the object ("Document"). Your Controls then simply
>> talk
>> to the class, which handles all the "dirty" work.
>>
>> --
>> HTH,
>>
>> Kevin Spencer
>> Microsoft MVP
>>
>> Printing Components, Email Components,
>> FTP Client Classes, Enhanced Data Controls, much more.
>> DSI PrintManager, Miradyne Component Libraries:
http://www.miradyne.net
>>
>> "Sir Psycho" <panuccio.vi...@gmail.com> wrote in message
>>
>> news:1177504335.208055.206370@t39g2000prd.googlegroups.com...
>>
>> > Hi,
>>
>> > I'm designing a form and I'd like to know when a control has been
>> > edited. I know how to get around this, by putting code behind every
>> > control to see if theres a change and then set a flag, but thats a
>> > waste of time and a lot of code to write.
>>
>> > I can see someone having a much more elegant solution, I just can't
>> > work it out. I was thinking of having every control inherit some
>> > master control so I can have one peice of code that 'detects' when a
>> > change has been made to any field or check box, just not sure how to
>> > go about it.
>>
>> > Anyone have a nice and simple solution?
>>
>> > Thanks,
>
>