есть форма screen, в нем только несколько Label1-7
код формы простой:
Public Class Screen
Private Sub Screen_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Me.StartPosition = FormStartPosition.Manual
Me.TopMost = True
Me.DesktopLocation = New System.Drawing.Point(My.Computer.Screen.Bounds.Width - Me.Width, My.Computer.Screen.Bounds.Height - Me.Height - Form1.TextBox2.Text)
Me.Show()
Timer1.Enabled = True
End Sub
Private Sub Timer1_Tick_1(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Timer1.Tick
If Me.Opacity < 0.01 Then Close()
Opacity -= 0.05
End Sub
End Class
есть форма form1 с несколькими combobox:
действия:
Private Sub ComboBox12_SelectionChangeCommitted(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox12.SelectionChangeCommitted
Dim NumOfSelectedItem As Byte
NumOfSelectedItem = ComboBox12.SelectedIndex
If (ComboBox12.SelectedIndex <> 0) Then
MyTrayList1.RemoveAt(NumOfSelectedItem)
TrayListToCombo(ComboBox13, MyTrayList1)
TrayListToCombo(ComboBox14, MyTrayList1)
If (ComboBox12.SelectedValue = "Давление") Then
Screen.Label3.Text = "Давление"
End If
If (ComboBox12.SelectedValue = "Время") Then
Screen.Label5.Text = "Время"
End If
If (ComboBox12.SelectedValue = "На солнце") Then
Screen.Label7.Text = "На солнце"
End If
Screen.Width = Screen.Width + 55
End If
End Sub
Private Sub ComboBox13_SelectionChangeCommitted(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox13.SelectionChangeCommitted
Dim NumOfSelectedItem As Byte
NumOfSelectedItem = ComboBox13.SelectedIndex
If (ComboBox13.SelectedIndex <> 0) Then
MyTrayList1.RemoveAt(NumOfSelectedItem)
TrayListToCombo(ComboBox12, MyTrayList1)
TrayListToCombo(ComboBox14, MyTrayList1)
If (ComboBox13.SelectedValue = "Давление") Then
Screen.Label3.Text = "Давление"
End If
If (ComboBox13.SelectedValue = "Время") Then
Screen.Label5.Text = "Время"
End If
If (ComboBox13.SelectedValue = "На солнце") Then
Screen.Label7.Text = "На солнце"
End If
Screen.Width = Screen.Width + 55
End If
End Sub
Private Sub ComboBox14_SelectionChangeCommitted(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ComboBox14.SelectionChangeCommitted
Dim NumOfSelectedItem As Byte
NumOfSelectedItem = ComboBox14.SelectedIndex
If (ComboBox14.SelectedIndex <> 0) Then
MyTrayList1.RemoveAt(NumOfSelectedItem)
TrayListToCombo(ComboBox12, MyTrayList1)
TrayListToCombo(ComboBox13, MyTrayList1)
If (ComboBox14.SelectedValue = "Давление") Then
Screen.Label3.Text = "Давление"
End If
If (ComboBox14.SelectedValue = "Время") Then
Screen.Label5.Text = "Время"
End If
If (ComboBox14.SelectedValue = "На солнце") Then
Screen.Label7.Text = "На солнце"
End If
Screen.Width = Screen.Width + 55
End If
End Sub
почему текст в label3-5-7 не меняется? как был label3-5-7 так и остается....
на index вместо value перейти нет возможности, потому что список меняется.
Ответить
|