The Undo method is used to undo the latest action.
Sub Undo()
void Undo()
HRESULT Undo()
See also UndoLevels method.
Public Class Form1
Friend WithEvents AxPDFCreactiveX1 As AxACPDFCREACTIVEX.AxPDFCreactiveX = New AxACPDFCREACTIVEX.AxPDFCreactiveX()
Friend WithEvents Undo As Button = New Button()
Friend WithEvents Redo As Button = New Button()
Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
' Form1
Me.Size = New System.Drawing.Size(400, 500)
' AxPDFCreactiveX1
AxPDFCreactiveX1.Enabled = True
AxPDFCreactiveX1.Location = New System.Drawing.Point(20, 20)
AxPDFCreactiveX1.Name = "AxPDFCreactiveX1"
AxPDFCreactiveX1.Parent = Me
AxPDFCreactiveX1.Size = New System.Drawing.Size(360, 400)
AxPDFCreactiveX1.TabIndex = 0
' Undo
Undo.Location = New System.Drawing.Point(20, 420)
Undo.Name = "Undo"
Undo.Size = New System.Drawing.Size(100, 40)
Undo.TabIndex = 1
Undo.Text = "Undo"
Undo.UseVisualStyleBackColor = True
Undo.Parent = Me
' Redo
Redo.Location = New System.Drawing.Point(200, 420)
Redo.Name = "Redo"
Redo.Size = New System.Drawing.Size(100, 40)
Redo.TabIndex = 1
Redo.Text = "Redo"
Redo.UseVisualStyleBackColor = True
Redo.Parent = Me
' Constants for Activation codes
Const strLicenseTo As String = "Amyuni PDF Creator Evaluation"
Const strActivationCode As String = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC"
' Set license key
AxPDFCreactiveX1.SetLicenseKey(strLicenseTo, strActivationCode)
' Change the PDF object to Designe Mode
AxPDFCreactiveX1.DoCommandTool(ACPDFCREACTIVEX.CommandToolConstants.acCommandToolDesignMode)
' Activate the command to draw lines
AxPDFCreactiveX1.DoCommandTool(ACPDFCREACTIVEX.CommandToolConstants.acCommandToolLine)
End Sub
Private Sub Undo_Click(sender As Object, e As EventArgs) Handles Undo.Click
' Undo an action (in this case, undo adding a line)
If AxPDFCreactiveX1.UndoLevels() > 0 Then
AxPDFCreactiveX1.Undo()
Else
MsgBox("No more Undo to perform")
End If
End Sub
Private Sub Redo_Click(sender As Object, e As EventArgs) Handles Redo.Click
' Redo what is undone (in this case Redo undoing the Line)
If AxPDFCreactiveX1.RedoLevels() > 0 Then
AxPDFCreactiveX1.Redo()
Else
MsgBox("No more Undo to Redo")
End If
End Sub
End Class
public partial class Form1 : Form
{
public AxACPDFCREACTIVEX.AxPDFCreactiveX axPDFCreactiveX1 = new AxACPDFCREACTIVEX.AxPDFCreactiveX();
public Button Undo = new Button();
public Button Redo = new Button();
public Form1()
{
InitializeComponent();
}
private void Form1_Load(object sender, EventArgs e)
{
// Form1
this.Size = new System.Drawing.Size(400, 500);
// axPDFCreactiveX1
axPDFCreactiveX1.Enabled = true;
axPDFCreactiveX1.Location = new System.Drawing.Point(20, 20);
axPDFCreactiveX1.Name = "axPDFCreactiveX1";
axPDFCreactiveX1.Parent = this;
axPDFCreactiveX1.Size = new System.Drawing.Size(360, 400);
axPDFCreactiveX1.TabIndex = 0;
// Undo
Undo.Location = new System.Drawing.Point(20, 420);
Undo.Name = "Undo";
Undo.Size = new System.Drawing.Size(100, 40);
Undo.TabIndex = 1;
Undo.Text = "Undo";
Undo.UseVisualStyleBackColor = true;
Undo.Parent = this;
Undo.Click += new System.EventHandler(Undo_Click);
// Redo
Redo.Location = new System.Drawing.Point(200, 420);
Redo.Name = "Redo";
Redo.Size = new System.Drawing.Size(100, 40);
Redo.TabIndex = 1;
Redo.Text = "Redo";
Redo.UseVisualStyleBackColor = true;
Redo.Parent = this;
Redo.Click += new System.EventHandler(Redo_Click);
// Constants for Activation codes
const string strLicenseTo = "Amyuni PDF Creator Evaluation";
const string strActivationCode = "07EFCDAB010001004282943F2AF19A88F332D9E781E40460727DF8A42847A1BDE06DB61C71E94E2D90424BF8762385335F9D6884E9FC";
// Set license key
axPDFCreactiveX1.SetLicenseKey(strLicenseTo, strActivationCode);
// Change the PDF object to Designe Mode
axPDFCreactiveX1.DoCommandTool(ACPDFCREACTIVEX.CommandToolConstants.acCommandToolDesignMode);
// Activate the command to draw lines
axPDFCreactiveX1.DoCommandTool(ACPDFCREACTIVEX.CommandToolConstants.acCommandToolLine);
}
private void Undo_Click(object sender, EventArgs e)
{
// Undo an action (in this case, undo adding a line)
if (axPDFCreactiveX1.UndoLevels() > 0)
{
axPDFCreactiveX1.Undo();
}
else
{
MessageBox.Show("No more Undo to perform");
}
}
private void Redo_Click(object sender, EventArgs e)
{
// Redo an action (in this case, Redo adding a line)
if (axPDFCreactiveX1.RedoLevels() > 0)
{
axPDFCreactiveX1.Redo();
}
else
{
MessageBox.Show("No more Redo to perform");
}
}
}