mindserve
asked on
Cancel print
This just cancels...I need to show the dialog and allow the user to either cancel or print...I am not getting anywhere with this code. Even though this is vb net, the code should be the same or similar in C#
-------------------------- ---------- ---------- ---
PrintFormulas.ShowDialog()
If CBool(Windows.Forms.Dialog Result.Can cel) = True Then
MsgBox("Printing Canceled")
Else
If CBool(Windows.Forms.Dialog Result.OK) Then
PD.Print()
End If
End If
--------------------------
PrintFormulas.ShowDialog()
If CBool(Windows.Forms.Dialog
MsgBox("Printing Canceled")
Else
If CBool(Windows.Forms.Dialog
PD.Print()
End If
End If
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Made some slight changes to your code but it works! ThX
Dim result As DialogResult
result = PrintFormulas.ShowDialog()
If result = Windows.Forms.DialogResult .Cancel Then
MsgBox("Printing Canceled")
Else
If result = Windows.Forms.DialogResult .OK Then
PD.Print()
End If
End If
Dim result As DialogResult
result = PrintFormulas.ShowDialog()
If result = Windows.Forms.DialogResult
MsgBox("Printing Canceled")
Else
If result = Windows.Forms.DialogResult
PD.Print()
End If
End If
ASKER
OOps...accepted the wrong person. Both code works though..should I split the points ..too late now?
You could request attention to the adminstrator and split the points
ASKER
Ok, will do that
thanks
MsgBox("Printing Canceled")
Else
If CBool(Windows.Forms.Dialog
PD.Print()
End If
End If