Hi misters,
I using BackgroundWorke r control in my Windows Forms. In my form, I have a
SplitterPanel.
In DoWork event , I create controls child, and in ProgressChanged event I
try add controls to SplitterPanel, but the application not responds. I use
InvokeRequired for controls child.
Any suggestions, please ?
Thanks in advance.
Private Sub bgCargaFichero_ DoWork(ByVal sender As System.Object, ByVal e As
System.Componen tModel.DoWorkEv entArgs) Handles bgCargaFichero. DoWork
Try
'SplitContainer 1.Panel1.Suspen dLayout()
'SplitContainer 1.Refresh()
' Procesar fichero
Me.ProcesarFich eroCargadoWork( ) ' IN THIS METHOD I CREATE CONTROLS Type =
ContenedorVisor Base
'SplitContainer 1.Panel1.Resume Layout(False)
If bgCargaFichero. CancellationPen ding = True Then
e.Cancel = True
Else
e.Result = True
End If
End Sub
Private Sub bgCargaFichero_ ProgressChanged (ByVal sender As System.Object,
ByVal e As System.Componen tModel.Progress ChangedEventArg s) Handles
bgCargaFichero. ProgressChanged
Dim contenedorPagin a As
GRUPOBACKUP.Adm inistrador.Util .Cliente.Contro lesWindows.Cont enedorVisorBase =
Nothing
contenedorPagin a = CType(e.UserSta te,
GRUPOBACKUP.Adm inistrador.Util .Cliente.Contro lesWindows.Cont enedorVisorBase )
If contenedorPagin a IsNot Nothing Then
AddMiniaturaToP anel(contenedor Pagina)
End If
=====
Delegate Sub AddMiniaturaToP anelDelegate2(B yVal cCTL As Control)
Private Sub AddMiniaturaToP anel(ByVal cCTL As Control)
If cCTL.InvokeRequ ired Then
Dim d As New AddMiniaturaToP anelDelegate2(A ddressOf AddMiniaturaToP anel)
Me.Invoke(d, New Object() {cCTL})
Else
SplitContainer1 .Panel1.Control s.Add(cCTL) ' Here, the application not
responds !!!!
End If
End Sub
--
I using BackgroundWorke r control in my Windows Forms. In my form, I have a
SplitterPanel.
In DoWork event , I create controls child, and in ProgressChanged event I
try add controls to SplitterPanel, but the application not responds. I use
InvokeRequired for controls child.
Any suggestions, please ?
Thanks in advance.
Private Sub bgCargaFichero_ DoWork(ByVal sender As System.Object, ByVal e As
System.Componen tModel.DoWorkEv entArgs) Handles bgCargaFichero. DoWork
Try
'SplitContainer 1.Panel1.Suspen dLayout()
'SplitContainer 1.Refresh()
' Procesar fichero
Me.ProcesarFich eroCargadoWork( ) ' IN THIS METHOD I CREATE CONTROLS Type =
ContenedorVisor Base
'SplitContainer 1.Panel1.Resume Layout(False)
If bgCargaFichero. CancellationPen ding = True Then
e.Cancel = True
Else
e.Result = True
End If
End Sub
Private Sub bgCargaFichero_ ProgressChanged (ByVal sender As System.Object,
ByVal e As System.Componen tModel.Progress ChangedEventArg s) Handles
bgCargaFichero. ProgressChanged
Dim contenedorPagin a As
GRUPOBACKUP.Adm inistrador.Util .Cliente.Contro lesWindows.Cont enedorVisorBase =
Nothing
contenedorPagin a = CType(e.UserSta te,
GRUPOBACKUP.Adm inistrador.Util .Cliente.Contro lesWindows.Cont enedorVisorBase )
If contenedorPagin a IsNot Nothing Then
AddMiniaturaToP anel(contenedor Pagina)
End If
=====
Delegate Sub AddMiniaturaToP anelDelegate2(B yVal cCTL As Control)
Private Sub AddMiniaturaToP anel(ByVal cCTL As Control)
If cCTL.InvokeRequ ired Then
Dim d As New AddMiniaturaToP anelDelegate2(A ddressOf AddMiniaturaToP anel)
Me.Invoke(d, New Object() {cCTL})
Else
SplitContainer1 .Panel1.Control s.Add(cCTL) ' Here, the application not
responds !!!!
End If
End Sub
--
Comment