0

the dll has a private method how can I call this method from my application?

Public Class FormAcceptanceBid2018

    Public OpenType As ClassStorage.enumBidFormOpenType
    Public ItemID As Integer

    Private Sub FormAcceptanceBid2018_Load(sender As Object, e As EventArgs) Handles MyBase.Load

            ....

            If ItemID > 0 Then
                FillForExistingItem()
            Else
                FillFormNewItem()
            End If
            ...

        End Sub
End Class

If I make this method public then everything works like this

FormAcceptanceBid2018 accepBid = new FormAcceptanceBid2018();
                    accepBid.ItemID = idBid;
                    accepBid.OpenType = ClassStorage.enumBidFormOpenType.ExistingItem; 
                    accepBid.FormAcceptanceBid2018_Load(null, null);   


                    accepBid.SaveBid();

Found on the Internet what can be called through reflection but I don’t understand how to fill in the variables accepBid.ItemID and accepBid.OpenType

typeof(FormAcceptanceBid2018).GetMethod("FormAcceptanceBid2018_Load", BindingFlags.NonPublic | BindingFlags.Instance).Invoke(new FormAcceptanceBid2018(), null);

0 Answers0