views:

67

answers:

1

Hi

I have re-hosted the workflow designer in my own application. Now I want to make the workflow view read-only. I know I can disallow drag&drop but delete and move should also be disabled. I still want the user to be able to scroll in the view.

Can anyone help.

Best regards, Michael

A: 

I came up with this solutaion:

  1. Created a MessageFilter inherited from WorkflowDesignerMessageFilter and attached it to the WorkflowView.
  2. Override method OnKeyDown

        if (eventArgs.KeyCode == Keys.Delete)
        {
            if(m_WorkflowView.AllowDrop)
            {
                return base.OnKeyDown(eventArgs);
            }
        }
        return true;
    

In this case I set AllowDrop to false on read-only view and true in DesignTime. If anyone has a better suggestion, please let me know.

Best regards, Michael

Michael Bendtsen