The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
this sample fire exception "Cannot call Close() while doing CreateHandle()."
1. What is the cause of this error?
2. Is there any solution and if yes, what it would be?
--- in main form
Dim frm As New Form2
Try
frm.MdiParent = Me
frm.Show()
Catch ex As Exception
MessageBox.Show(ex.Message)
End Try
--- in child form
Dim bUslov As Boolean
Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
'---- code
bUslov = True
' ----- code
If bUslov Then
Me.Close()
End If
End Sub
Yoy can not create Handle and then call Close() method. Try to set "frm.MdiParent = Me" after show method, outside try & catch block.
>this sample fire exception "Cannot call Close() while doing CreateHandle()."
>
>1. What is the cause of this error?
>2. Is there any solution and if yes, what it would be?
>
>--- in main form
>
> Dim frm As New Form2
> Try
> frm.MdiParent = Me
> frm.Show()
> Catch ex As Exception
> MessageBox.Show(ex.Message)
> End Try
>
>--- in child form
>
> Dim bUslov As Boolean
>
> Private Sub Form2_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
>
> ''---- code
>
> bUslov = True
>
> '' ----- code
>
> If bUslov Then
> Me.Close()
> End If
>
> End Sub
>
>
>
>
>
>