combit List & Label 29 - .NET Help
combit.Reporting Namespace / DesignerObject Class / EditDesignerObject Event


In This Topic
    EditDesignerObject Event
    In This Topic

    This event is triggered, when the user double clicks on the newly added object or selects the item "Properties" from the context menu. Here as well, you can gain access to the designer window through event arguments, and a separate dialog can be displayed. In the example, you see the display of a file selection dialog. Here, you can choose a graphic to be displayed in the designer. The dialog is displayed by double-clicking on the object.

    Syntax
    'Declaration
     
    
    Public Event EditDesignerObject As EditDesignerObjectHandler
    public event EditDesignerObjectHandler EditDesignerObject
    public:
    event EditDesignerObjectHandler^ EditDesignerObject
    Event Data

    The event handler receives an argument of type EditDesignerObjectEventArgs containing data related to this event. The following EditDesignerObjectEventArgs properties provide information specific to this event.

    PropertyDescription

    Access to the designer window.

     
    Set to indicate if the object has been changed.  
    Example
    private void designerObject1_EditDesignerObject(object sender, EditDesignerObjectEventArgs e)
    {
         DesignerObject desobj = (DesignerObject) sender;
         OpenFileDialog dialog = new OpenFileDialog();
         dialog.Filter = "JPEG files (*.jpg)|*.jpg|All files (*.*)|*.*";
    
         if(desobj.ObjectProperties.Contains("imagefile"))
              dialog.FileName = desobj.ObjectProperties["imagefile"].ToString();
    
         if(dialog.ShowDialog(e.DesignerWindow) == DialogResult.OK)
         {
              desobj.ObjectProperties["imagefile"] = dialog.FileName;
              e.HasChanged = true;
         }
    } 
    
    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