943,616 Members | Top Members by Rank

Ad:
  • ASP.NET Discussion Thread
  • Unsolved
  • Views: 5191
  • ASP.NET RSS
Apr 18th, 2005
0

undo/redo help!!!

Expand Post »
hey guys...

i need help on making an undo/redo command in my menu...

can ya help!

o yeah! plz put this stuff n the simplist terms that you can think of like (insert this code here and this there)

i just got vb standard 2003 3 days ago, and have no programming experience (except for HTML), therefore i am a NOOB!!! :p

thx!

Pat
Similar Threads
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mntlnstituteflr is offline Offline
4 posts
since Apr 2005
Apr 19th, 2005
0

Re: undo/redo help!!!

anybody... anybody...???

Pat
Reputation Points: 10
Solved Threads: 0
Newbie Poster
mntlnstituteflr is offline Offline
4 posts
since Apr 2005
Apr 28th, 2005
1

Re: undo/redo help!!!

In the click events of your menu items you just need to call the undo/redo methods of the RichTextBox or TextBox you have on your form....You can also check to see if it's possible to undo or redo in the popup event of your menuitem's parent

For example, if I had a menuitem called miEdit with two child menuitems called miEditUndo and miEditRedo and a RichTextBox called rtbText I'd so this:

The popup event for miEdit:
ASP.NET Syntax (Toggle Plain Text)
  1. public void miEdit_Popup(object sender, System.EventArgs e)
  2. {
  3. if(rtbText.CanUndo)
  4. miEditUndo.Enabled = true;
  5. else
  6. miEditUndo.Enabled = false;
  7. if(rtbText.CanRedo)
  8. miEditRedo.Enabled = true;
  9. else
  10. miEditRedo.Enabled = false;
  11. }

Then for the click even of the Undo button:
ASP.NET Syntax (Toggle Plain Text)
  1. public void miEditUndo_Click(object sender, System.EventArgs e)
  2. {
  3. rtbText.Undo();
  4. }

Then for the click event of the Redo MenuItem
ASP.NET Syntax (Toggle Plain Text)
  1. public void miEditRedo_Click(object sender, System.EventArgs e)
  2. {
  3. rtbText.Redo();
  4. }

That's how you do it
Reputation Points: 46
Solved Threads: 2
Junior Poster
Iron_Cross is offline Offline
117 posts
since Jul 2003

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in ASP.NET Forum Timeline: instrumenting an application in .NET
Next Thread in ASP.NET Forum Timeline: SONET architecture as it relates to Voice over IP





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC