vb點(diǎn)虐 怎么設(shè)置移動 vbnet doevent

用vb點(diǎn)虐 編寫項(xiàng)目移動。。。求高人指點(diǎn)。。。。

窗體是指由兩個列表框(ListBox1、ListBox2)和4個命令按鈕(Button1“”按鈕,Button2“”按鈕,Button3“”按鈕,Button4“”按鈕)所構(gòu)成的界面,代碼:

創(chuàng)新互聯(lián)專注于南山網(wǎng)站建設(shè)服務(wù)及定制,我們擁有豐富的企業(yè)做網(wǎng)站經(jīng)驗(yàn)。 熱誠為您提供南山營銷型網(wǎng)站建設(shè),南山網(wǎng)站制作、南山網(wǎng)頁設(shè)計(jì)、南山網(wǎng)站官網(wǎng)定制、微信平臺小程序開發(fā)服務(wù),打造南山網(wǎng)絡(luò)公司原創(chuàng)品牌,更為您提供南山網(wǎng)站排名全網(wǎng)營銷落地服務(wù)。

Public Class Form1

Private Sub Form1_Load(sender As System.Object, e As System.EventArgs) Handles MyBase.Load

Me.Text = "選項(xiàng)移動"

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

求大神指點(diǎn)vb點(diǎn)虐 怎么用SendInput來實(shí)現(xiàn)鼠標(biāo)移動到指定位置呢?

您好,建議您使用mouse_event或者?Cursor.Position來實(shí)現(xiàn)。例如:

1. 您需要將鼠標(biāo)移動dx, dy的位置。

Public?Sub?MouseMoveBy(ByVal?dx?As?Integer,?ByVal?dy?As?Integer)

Cursor.Position?=?New?Point(Cursor.Position.X?+?dx,?Cursor.Position.Y?+?dy)

End?Sub

或者

Public?Sub?MouseMoveBy(ByVal?dx?As?Integer,?ByVal?dy?As?Integer)

mouse_event(0,?dx,?dy,?0,?0)

End?Sub

2. 您需要將鼠標(biāo)移動到x, y的位置

Public?Sub?MouseMoveTo(ByVal?x?As?Integer,?ByVal?y?As?Integer)

Cursor.Position?=?New?Point(x,?y)

End?Sub

請您試一下。

vb點(diǎn)虐 如何移動文件夾?

Microsoft.VisualBasic.FileSystem.Rename(原文件夾完整路徑名稱,新的文件夾名稱)

Microsoft.VisualBasic.FileSystem.Rename("D:\1", "D:\2\1")‘當(dāng)路徑不對時會把原文件夾剪切到“D:\2\”下面文件夾名稱不變

Microsoft.VisualBasic.FileSystem.Rename("D:\1", "D:\2\2")")‘當(dāng)路徑不對時會把原文件夾剪切到“D:\2\”下面文件夾名稱 更改為 2

Microsoft.VisualBasic.FileSystem.Rename("D:\1", "D:\2")’當(dāng)路徑相同時只改文件夾名稱 不移動文件

網(wǎng)站題目:vb點(diǎn)虐 怎么設(shè)置移動 vbnet doevent
鏈接URL:http://muchs.cn/article26/ddighjg.html

成都網(wǎng)站建設(shè)公司_創(chuàng)新互聯(lián),為您提供網(wǎng)站制作、Google用戶體驗(yàn)網(wǎng)站導(dǎo)航、軟件開發(fā)域名注冊

廣告

聲明:本網(wǎng)站發(fā)布的內(nèi)容(圖片、視頻和文字)以用戶投稿、用戶轉(zhuǎn)載內(nèi)容為主,如果涉及侵權(quán)請盡快告知,我們將會在第一時間刪除。文章觀點(diǎn)不代表本網(wǎng)站立場,如需處理請聯(lián)系客服。電話:028-86922220;郵箱:631063699@qq.com。內(nèi)容未經(jīng)允許不得轉(zhuǎn)載,或轉(zhuǎn)載時需注明來源: 創(chuàng)新互聯(lián)

手機(jī)網(wǎng)站建設(shè)