有没有办法弄清楚哪个组合框的选定事件被触发,所以我可以把它发送到新的表格?
我基本上想知道哪个组合框正在发送请求,所以我可以在屏幕上放置相应的文本。代码如下:
Private Sub cboDecision_SelectedIndexChanged(sender As System.Object, e As System.EventArgs) Handles cboLife1.SelectedIndexChanged, cboLife2.SelectedIndexChanged, cboLife3.SelectedIndexChanged
If cboLife1.SelectedText = "Accept" Then
MessageBox.Show("Yes")
Else
Dim dec As frmDeclined = New frmDeclined(Pass control name here??)
dec.ShowDialog()
End If
End Sub
Sub New(ctrlStep6 As ctrlStep6)
InitializeComponent()
step6 = ctrlStep6
Code with name of person selected from the correct combobox here
lblMember.Text = nameFromComboBox
End Sub
这是我到目前为止所得到的但是对于如何将控件的名称传递给frmDeclined感到难过。
答案 0 :(得分:1)
请尝试此操作以确定哪个控制字段是请求的实际发件人。
DirectCast(sender, Control).Name