Search code examples
vb.netruntime-error

How to fix VB.NET error 'Parameter not valid'?


I have created an application in VB.NET but when this code runs:

Public Class Form1
    Private Sub Form1_Load(sender As Object, e As EventArgs) Handles MyBase.Load

    End Sub

    Private Sub gen_Click(sender As Object, e As EventArgs) Handles gen.Click
        Dim b As IronBarCode.GeneratedBarcode = IronBarCode.BarcodeWriter.CreateBarcode(url.Text, IronBarCode.BarcodeWriterEncoding.QRCode)
        Dim bimg As Image = b.Image
        code.BackgroundImageLayout = ImageLayout.Zoom
        code.BackgroundImage = bimg
        transition.Hide(login)
    End Sub
End Class

I get the error 'Parameter not valid' and the application enters break mode. I have tried inserting breakpoints in my code but I have not found where the error came from. How can I fix this?


Solution

  • I found the error.

    transition.Hide(login)
    

    It is a component from an external library. The error was generated there.