Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

"Modified" property 1

Status
Not open for further replies.

RSX02

Programmer
May 15, 2003
467
CA
Hi
I saw that a textbox has the property "modified" does it have something similar for a combobox? I didn't see anything
Thanks in advance
 
modified is a built in "IsDirty". When the text box is instantiated, modified is set to false. As soon as a user changes the .text value of the text box, the value of modified is set to true.

This is how you can tell if a value has been changed befor closeing/saving/etc a form, just cycle through the controls collection looking for anything that has been modified.

-Rick

----------------------
 
OMG - this just reiterates the fact that i have much more to learn. i would have saved a lot of time if i had known that sooner. i need to buy a book.


hayt
 
To tell the truth Hayt, I didn't know what it was at the moment either. But I'm familier with the IsDirty practice and figured is was implimented some how in .Net. Hop into the IDE, add a text box and look at the properties in code. The intellisence and pop ups fill you in on the details.

-Rick

----------------------
 
So do you think it has a property that does the same in a combobox?
 
combobox has several methods to checl if it's changed

.selectedvaluechanged
.selectedindexchanged
.selectedtextchanged
...

I think you should use these.

and I couldn't find a modified for a comobobox. but you can make your own.

Christiaan Baes
Belgium

If you want to get an answer read this FAQ faq796-2540
There's no such thing as a winnable war - Sting
 
Christiaan
I tried this
Me.Country.SelectedValueChanged
which "country" is my combobox
and it's underline the line as it's not valid.
 
I don't know of one if there is. You could create a custom class that would have it. Inherit the combo box and add a public property Modified. Then either impliment an event handler inside your custom class to change Modified to True when the value changes, or add that code to your application and just have it set the .Modified value from the app.

The later would be preferable, but I haven't found a way to handle an event inside of an inherited control and throw that event again for the form that the control is on. Maybe one of the Pros here has an idea.

The goal would be to handle the ComboBox1.TextChanged or selected change inside the custom class and then raise that same event for the form that the combo box is on. Hope that makes sence.

-Rick

----------------------
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top