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!

undo function 1

Status
Not open for further replies.

231166

Programmer
Apr 5, 2005
104
FR
Hi,

i would like to create a function which permits to a user to annul the last action he has done.
i had a lok on msdn but what i saw is not so clear :
Code:
if DTE.ActiveDocument.Undo Then

what is exactly DTE.ActiveDocument

Do i need abslolutely to use it for annuling the last function?

Could you help me on this point.

Thanks a lot for your help.

Nathalie
 
DTE has to do with macros. ActiveDocument refers to the current code window.

In my experience there isnt a way to undo as user's changes in Visual studio.
 
Hi,

If there is no way to undo changes in vb.net why does this function exist in the index of all the vb.net functions??

Regards.

Nathalie
 
If your form consists of only textboxes here is a start.

Code:
        For Each ctl As Control In Me.Controls
            If TypeOf ctl Is TextBox Then
                CType(ctl, TextBox).Undo()
            End If
        Next

I looked and I didnt see an Undo function for the Me keyword, i saw an undo function for text boxes, and i didnt see one for checkboxes.

Where are you looking that you see an undo function for all functions.
 
You'll need to write a fair amount of code to support this in a generic fashion. Investigate the Command pattern for this.


Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
I know I didnt start the thread but I appreciate the information. THanks ChipH. Star.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top