I have a form and in one set of code it is call as modal and in another set of code it is called non modal. There is a control on the form that presents a dropdown box. We provide a datasource to the dropdown which is a list. When we get the all the data elements from the database if there is a value that can be applied to the dropdown before any user input is performed we assigned it to the selectedvalue property and it should be displayed in the text area of the control.
On the non modal form the the correct value is shown in the text area of the dropdown control. When in modal it does not. I have walked through the code several times to make sure we hit the same code and we do and the selectedvalue is assigned to the control. Why does the control not display correctly when in modal form.
What is happening that causes the different behavior?
modal
non modal
On the non modal form the the correct value is shown in the text area of the dropdown control. When in modal it does not. I have walked through the code several times to make sure we hit the same code and we do and the selectedvalue is assigned to the control. Why does the control not display correctly when in modal form.
What is happening that causes the different behavior?
modal
VB.NET:
Protected Overrides Function MyFunction(ByVal args As StatusChangeArgs, ByRef isNewStatusAvailable As Boolean) As Boolean
Dim aod As frmAOD = New frmAOD(True)
aod.Text = "title text"
isNewStatusAvailable = True
aod.LoadUnit(args.UnitName)
Return aod.ShowDialog() = System.Windows.Forms.DialogResult.OK
End Function
non modal
VB.NET:
Public Sub Mysub(ByVal arg As IUserCommand)
dim _aod as frmAOD = New frmAPD(True)
_aod.TopMost = True
_aod.WindowState = _aod.LastNonMinimizedWindowState
_aod.Text = "title text"
_aod.Show()
_aod.LoadUnit(arg)
_aod.Activate()
End Sub