1

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:
[code]
public void miEdit_Popup(object sender, System.EventArgs e)
{
if(rtbText.CanUndo)
miEditUndo.Enabled = true;
else
miEditUndo.Enabled = false;
if(rtbText.CanRedo)
miEditRedo.Enabled = true;
else
miEditRedo.Enabled = false;
}
[/code]

Then for the click even of the Undo button:
[code]
public void miEditUndo_Click(object sender, System.EventArgs e)
{
rtbText.Undo();
}
[/code]

Then for the click event of the Redo MenuItem
[code]
public void miEditRedo_Click(object sender, System.EventArgs e)
{
rtbText.Redo();
}
[/code]

That's how you do it ;)

11

I often see people asking the same question over and over, "How do I learn to program, and where do I start?" Some people may take that question to the next level by asking, "Which language should I learn first?". The answer to those questions is fairly simple, but also a little subjective. So I'm going to attempt to help solve those very valid, logical questions.

[b]How do I program? [/b]
Programming is the act of giving the computer information and directions to complete a certain task. Most often programming is achieved by typing in a certain "Programming Language" into a normal text editor, then compiled (or 'made' into machine language that the computer can understand) into native or interpreted code, which I'll explain soon. There is also several programs that are called IDE's or Integrated Development Environments. These are useful in several aspects. For one, they look similar to a normal text editor, but they color coordinate your code, to make it easier to read at a glance. They can also perform automated tasks for, that ease up the amount of typing you have to do. They also provide a single area to write, compile, link, test, and run your programs, without having to use several different utilities. But you are not forced to use an IDE, it just makes your job, as the programmer, slightly easier. Now, you can't just use any IDE you want, most often, IDEs are specialized for a certain language. Search for the proper ...

Votes + Comments
Nice! And you managed to keep your pure OOP / Java bias (almost) under control!
Great FAQ!
Great!
very good summary of languages and getting started on programming
Well Done!
Good one - ~s.o.s~
1

go to [url]www.seclude.org[/url] it's an entire messaging system, like aim or msn or whatnot. It's written in Java, and it's fully open source and free to download. It also implements some very advanced encryption techniques. It's quite possibly the safest way to talk over the internet. Download it and see how they conquered this problem.