用vb.net编写项目移动。。。求高人指点。。。
发布网友
发布时间:2022-04-27 11:32
我来回答
共2个回答
热心网友
时间:2022-04-27 13:02
窗体是指由两个列表框(ListBox1、ListBox2)和4个命令按钮(Button1“>”按钮,Button2“>>”按钮,Button3“<”按钮,Button4“<<”按钮)所构成的界面,代码:
Public Class Form1
Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load
Me.Text = "选项移动"
ListBox1.SelectionMode = SelectionMode.MultiSimple
ListBox2.SelectionMode = SelectionMode.One
For i = 1 To 10
ListBox1.Items.Add(Chr(Asc("a") + i - 1))
Next
For i = 1 To 10
ListBox2.Items.Add(i.ToString)
Next
End Sub
Private Sub Button1_Click(sender As System.Object, e As System.EventArgs) Handles Button1.Click
If ListBox1.SelectedItems Is Nothing Then Exit Sub
Dim b As ListBox.ObjectCollection
For i = 0 To Me.ListBox1.SelectedItems.Count - 1
Me.ListBox2.Items.Add(Me.ListBox1.SelectedItems(0))
Me.ListBox1.Items.RemoveAt(Me.ListBox1.SelectedIndices(0))
Next
End Sub
Private Sub Button3_Click(sender As System.Object, e As System.EventArgs) Handles Button3.Click
If ListBox2.SelectedItems IsNot Nothing Then
ListBox1.Items.Add(ListBox2.SelectedItem)
ListBox2.Items.Remove(ListBox2.SelectedItem)
End If
End Sub
Private Sub Button2_Click(sender As System.Object, e As System.EventArgs) Handles Button2.Click
For Each itm As Object In ListBox1.Items
ListBox2.Items.Add(itm)
Next
ListBox1.Items.Clear()
End Sub
Private Sub Button4_Click(sender As System.Object, e As System.EventArgs) Handles Button4.Click
For Each itm As Object In ListBox2.Items
ListBox1.Items.Add(itm)
Next
ListBox2.Items.Clear()
End Sub
End Class
热心网友
时间:2022-04-27 14:20
这个是引导线动画呀。把小球做成一个元件,再做一个墙壁的背景层,再做一层引导线,一共三层。很简单的!