undo/redo help!!!

Please support our ASP.NET advertiser: Intel Parallel Studio Home
Reply

Join Date: Apr 2005
Posts: 4
Reputation: mntlnstituteflr is an unknown quantity at this point 
Solved Threads: 0
mntlnstituteflr mntlnstituteflr is offline Offline
Newbie Poster

undo/redo help!!!

 
0
  #1
Apr 18th, 2005
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
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 4
Reputation: mntlnstituteflr is an unknown quantity at this point 
Solved Threads: 0
mntlnstituteflr mntlnstituteflr is offline Offline
Newbie Poster

Re: undo/redo help!!!

 
0
  #2
Apr 19th, 2005
anybody... anybody...???

Pat
Reply With Quote Quick reply to this message  
Join Date: Jul 2003
Posts: 117
Reputation: Iron_Cross is an unknown quantity at this point 
Solved Threads: 2
Iron_Cross's Avatar
Iron_Cross Iron_Cross is offline Offline
Junior Poster

Re: undo/redo help!!!

 
1
  #3
Apr 28th, 2005
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:
  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:
  1. public void miEditUndo_Click(object sender, System.EventArgs e)
  2. {
  3. rtbText.Undo();
  4. }

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

That's how you do it
elitehackers.info
Today's Penny-Arcade!
Pain is weakness leaving the body!
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC