GoDigram for .NET Framework and .NET Core
Northwoods.Go Namespace / GoText Class / DoBeginEdit Method
In This Topic
    DoBeginEdit Method (GoText)
    In This Topic
    Bring up a TextBox or other Control to allow the user to edit the text string in-place.
    Syntax
    public override void DoBeginEdit( 
       GoView view
    )

    Parameters

    view
    Remarks

    This is responsible for calling GoView.StartTransaction. (DoEndEdit is responsible for finishing the transaction.) This basically sets both Editor and GoView.GoView.EditControl to the result from calling CreateEditor. However, this method does nothing if an edit is already in progress, when Editor is not null.

    If you override this method, you can perform some customization of the resulting Control for the given GoView by first calling the base method and then looking at the Control, as follows:

    
                public override void DoBeginEdit(GoView view) {
                  base.DoBeginEdit(view);
                  if (this.Editor == null) return;  // failed to create editor
                  // get the Control for the Editor created in base method for this GoText
                  System.Windows.Forms.Control ctrl = this.Editor.GetControl(view);
                  if (ctrl != null) {
                    ... simple Control customization ...
                  }
                }
                

    However, many Controls require more sophisticated behavior, which is best implemented by inheriting from that particular Control class, implementing IGoControlObject, and handling the desired events. Normally that is done by overriding CreateEditor instead of overriding this method.

    See Also