combit List & Label 30 - .NET Help
combit.Reporting Namespace / EditDesignerObjectHandler Delegate


EditDesignerObjectHandler Delegate

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 Delegate Sub EditDesignerObjectHandler( _
   ByVal sender As Object, _
   ByVal e As EditDesignerObjectEventArgs _
) 
 

Parameters

sender
e
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 8, .NET 9

See Also