0 votes

For override events from webbrowser/mailbrowser must be this component inserted to form - I'm not lucky with this...
VS2022, VB forms project .NET 6.0, x64
Now - only way which I found - adding control in Load event of main form:

   Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load
        'add mail browser object
        Me.Controls.Add(_mailBrowser)
        AddHandler _mailBrowser.DocumentCompleted, AddressOf abc
End sub
    Sub abc(sender As Object, e As WebBrowserDocumentCompletedEventArgs)
    End Sub

But this generate error "DocumentCompleted is not event in Object" in design time. How can I add this control from toolbar? Respectively, haw add control to toolbar<
If I try open your example Samples_VB from downloaded package - EmailViewer, trying open form in designer cause error - Type Limilabs.Windows.MailBrowserControl not found...

Any idea? Thanks.

Pavel

by (300 points)
retagged by

1 Answer

0 votes

Visual Studio 2019 and it's designer is 32 bit.
Visual Studio 2022 and it's designer is 64 bit.

If you are using Visual Studio 2022, add reference to x64 folder:

<Reference Include="MailBrowserControl">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>
        ..\..\Lib\MailBrowserControl\x64\MailBrowserControl.dll
  </HintPath>
</Reference>
<Reference Include="ProtocolEx">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>
        ..\..\Lib\MailBrowserControl\x64\ProtocolEx.dll
  </HintPath>
</Reference>

Similar when adding control to toolbox - use 64 bit version for VS 2022.

by (297k points)
...