ramone Posted October 5, 2005 Posted October 5, 2005 hello i have a button in my main form that shows a modal dialogbox, the user inputs data in the dialogbox and then click ok to save the data, but the execution doesn't resume after the form.showdialog() line, heres my code: Private Sub verBotonAgregarCita_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles verBotonAgregarCita.Click Dim acitas As New aCitas 'new dialogbox acitas.idpacientecur = idPacienteCur acitas.ShowDialog() 'nothing after this line will be executed 'code to update a datagrid Dim query As String Dim citas As New DataTable query = "select id_cita,tratamiento,anticipo,fecha from citas where id_paciente=" + idPacienteCur citas = selectDatos(Me.cnxStr, query) verTablaCitas.DataBindings.Clear() verTablaCitas.SetDataBinding(citas, "") estilo1.MappingName = citas.TableName colSaldo.MappingName = citas.Columns(2).ColumnName colTratamiento.MappingName = citas.Columns(1).ColumnName colFecha.MappingName = citas.Columns(3).ColumnName colId.MappingName = citas.Columns(0).ColumnName End Sub what can i do tho resume the execution after the showdialog call?? thank you Quote
techmanbd Posted October 5, 2005 Posted October 5, 2005 Because when you do a showdialog it stops the program until what ever you are showing is handled. Quote Live as if you were to die tomorrow. Learn as if you were to live forever. Gandhi
Leaders snarfblam Posted October 5, 2005 Leaders Posted October 5, 2005 ShowDialog will pause execution of the calling sub until the form is closed or hidden. Is this the behavior that you are observing? Quote [sIGPIC]e[/sIGPIC]
ramone Posted October 5, 2005 Author Posted October 5, 2005 the dialogbox has a me.close, it closes and then it is supposed to resume the execution and update the datagrid Quote
Leaders snarfblam Posted October 5, 2005 Leaders Posted October 5, 2005 Do a debugger step-through, and see what happens. If you give us more info we can give you more help. Quote [sIGPIC]e[/sIGPIC]
ramone Posted October 5, 2005 Author Posted October 5, 2005 i think the problem is the update of the datagrid, it has only one datatable and it doesn't update with the new datatable, how can i update it?? thank you Quote
georgepatotk Posted October 6, 2005 Posted October 6, 2005 do somehting like verTablaCitas.Refresh Quote George C.K. Low
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.