combit List & Label 29 - .NET Help
combit.Reporting Namespace / DrawDesignerObjectEventArgs Class / IsDesignMode Property
Example


In This Topic
    IsDesignMode Property (DrawDesignerObjectEventArgs)
    In This Topic
    Returns 'true' if the view in the Designer is 'Layout' or 'Layout Preview'. You can control if only the first page of the Designer object has to be drawn in design mode. If 'false' is returned, it means that you are in print mode and drawing has to be made for the complete Designer object.
    Syntax
    'Declaration
     
    
    Public ReadOnly Property IsDesignMode As Boolean
    public bool IsDesignMode {get;}
    public:
    property bool IsDesignMode {
       bool get();
    }
    Example
    class MyDesignerObject : DesignerObject
    {
    	// ...
    	protected override void OnDrawDesignerObject(DrawDesignerObjectEventArgs e)
    	{
    		// Design mode or print mode?
    		if (e.IsDesignMode)
    			e.PrintFinished = true;
    		else
    			e.PrintFinished = _lastPage; // Last page?
    		
    		// ...
    	}
    	// ...
    }
    Class MyDesignerObject
    	Inherits DesignerObject
    	' ...
    	Protected Overrides Sub OnDrawDesignerObject(e As DrawDesignerObjectEventArgs)
    		' Design mode or print mode?
    		If e.IsDesignMode Then
    			e.PrintFinished = True
    		Else
    			e.PrintFinished = _lastPage ' Last page?
    		End If
    		' ...
    	End Sub
    	' ...
    End Class
    Requirements

    Platforms: Windows 10 (Version 21H2 - 23H2), Windows 11 (21H2 - 22H2), Windows Server 2016 - 2022
    .NET: .NET Framework 4.8, .NET 6, .NET 7, .NET 8

    See Also