mirror of
https://github.com/Histacom/Histacom.git
synced 2025-01-22 09:02:00 -05:00
Draggable Desktop Icons added (Vista skipped until start menu is finished to prevent messing with Whistler's code.)
This commit is contained in:
parent
3b4c3af99d
commit
886804440e
4 changed files with 70 additions and 0 deletions
|
@ -35,6 +35,8 @@
|
||||||
Me.desktopicons.BackgroundImage = bmp
|
Me.desktopicons.BackgroundImage = bmp
|
||||||
commandpromptstartup.Start()
|
commandpromptstartup.Start()
|
||||||
comn = 100
|
comn = 100
|
||||||
|
desktopicons.AutoArrange = False
|
||||||
|
desktopicons.AllowDrop = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotePadToolStripMenuItem.Click
|
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotePadToolStripMenuItem.Click
|
||||||
|
@ -400,4 +402,20 @@
|
||||||
opentime.Show()
|
opentime.Show()
|
||||||
startmenu.Hide()
|
startmenu.Hide()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub desktopicons_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles desktopicons.ItemDrag
|
||||||
|
Dim lvi As ListViewItem = CType(e.Item, ListViewItem)
|
||||||
|
desktopicons.DoDragDrop(New DataObject("System.Windows.Forms.ListViewItem", lvi), DragDropEffects.Move)
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragEnter
|
||||||
|
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem") Then
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragOver
|
||||||
|
Dim lvi As ListViewItem = CType(e.Data.GetData("System.Windows.Forms.ListViewItem"), ListViewItem)
|
||||||
|
Dim Offset As Size = Size.Subtract(Cursor.Size, New Size(Cursor.HotSpot.X, Cursor.HotSpot.Y))
|
||||||
|
lvi.Position = Point.Subtract(desktopicons.PointToClient(New Point(e.X, e.Y)), Offset)
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -24,6 +24,8 @@
|
||||||
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
|
Me.FormBorderStyle = Windows.Forms.FormBorderStyle.None
|
||||||
Me.WindowState = FormWindowState.Maximized
|
Me.WindowState = FormWindowState.Maximized
|
||||||
System.Windows.Forms.Application.VisualStyleState = VisualStyles.VisualStyleState.NoneEnabled
|
System.Windows.Forms.Application.VisualStyleState = VisualStyles.VisualStyleState.NoneEnabled
|
||||||
|
desktopicons.AutoArrange = False
|
||||||
|
desktopicons.AllowDrop = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotePadToolStripMenuItem.Click
|
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotePadToolStripMenuItem.Click
|
||||||
|
@ -261,4 +263,19 @@
|
||||||
showmess.infomessage.Text = "Your save code is: sdu247w4"
|
showmess.infomessage.Text = "Your save code is: sdu247w4"
|
||||||
showmess.Show()
|
showmess.Show()
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Sub desktopicons_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles desktopicons.ItemDrag
|
||||||
|
Dim lvi As ListViewItem = CType(e.Item, ListViewItem)
|
||||||
|
desktopicons.DoDragDrop(New DataObject("System.Windows.Forms.ListViewItem", lvi), DragDropEffects.Move)
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragEnter
|
||||||
|
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem") Then
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragOver
|
||||||
|
Dim lvi As ListViewItem = CType(e.Data.GetData("System.Windows.Forms.ListViewItem"), ListViewItem)
|
||||||
|
Dim Offset As Size = Size.Subtract(Cursor.Size, New Size(Cursor.HotSpot.X, Cursor.HotSpot.Y))
|
||||||
|
lvi.Position = Point.Subtract(desktopicons.PointToClient(New Point(e.X, e.Y)), Offset)
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
||||||
|
|
|
@ -36,6 +36,8 @@
|
||||||
commandpromptstartup.Start()
|
commandpromptstartup.Start()
|
||||||
System.Windows.Forms.Application.VisualStyleState = VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled
|
System.Windows.Forms.Application.VisualStyleState = VisualStyles.VisualStyleState.ClientAndNonClientAreasEnabled
|
||||||
System.Windows.Forms.Application.EnableVisualStyles()
|
System.Windows.Forms.Application.EnableVisualStyles()
|
||||||
|
desktopicons.AutoArrange = False
|
||||||
|
desktopicons.AllowDrop = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs)
|
||||||
|
@ -424,4 +426,19 @@
|
||||||
showmess.errormessage.Text = "your save code is: bsdn98e5"
|
showmess.errormessage.Text = "your save code is: bsdn98e5"
|
||||||
showmess.Show()
|
showmess.Show()
|
||||||
End Sub
|
End Sub
|
||||||
|
Private Sub desktopicons_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles desktopicons.ItemDrag
|
||||||
|
Dim lvi As ListViewItem = CType(e.Item, ListViewItem)
|
||||||
|
desktopicons.DoDragDrop(New DataObject("System.Windows.Forms.ListViewItem", lvi), DragDropEffects.Move)
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragEnter
|
||||||
|
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem") Then
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragOver
|
||||||
|
Dim lvi As ListViewItem = CType(e.Data.GetData("System.Windows.Forms.ListViewItem"), ListViewItem)
|
||||||
|
Dim Offset As Size = Size.Subtract(Cursor.Size, New Size(Cursor.HotSpot.X, Cursor.HotSpot.Y))
|
||||||
|
lvi.Position = Point.Subtract(desktopicons.PointToClient(New Point(e.X, e.Y)), Offset)
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -32,6 +32,8 @@
|
||||||
End Using
|
End Using
|
||||||
Me.BackgroundImage = bmp
|
Me.BackgroundImage = bmp
|
||||||
Me.desktopicons.BackgroundImage = bmp
|
Me.desktopicons.BackgroundImage = bmp
|
||||||
|
desktopicons.AutoArrange = False
|
||||||
|
desktopicons.AllowDrop = True
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotePadToolStripMenuItem.Click
|
Private Sub NotePadToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles NotePadToolStripMenuItem.Click
|
||||||
|
@ -261,4 +263,20 @@
|
||||||
openinternet.Show()
|
openinternet.Show()
|
||||||
startmenu.Hide()
|
startmenu.Hide()
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub desktopicons_ItemDrag(ByVal sender As Object, ByVal e As System.Windows.Forms.ItemDragEventArgs) Handles desktopicons.ItemDrag
|
||||||
|
Dim lvi As ListViewItem = CType(e.Item, ListViewItem)
|
||||||
|
desktopicons.DoDragDrop(New DataObject("System.Windows.Forms.ListViewItem", lvi), DragDropEffects.Move)
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragEnter(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragEnter
|
||||||
|
If e.Data.GetDataPresent("System.Windows.Forms.ListViewItem") Then
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End If
|
||||||
|
End Sub
|
||||||
|
Private Sub desktopicons_DragOver(ByVal sender As Object, ByVal e As System.Windows.Forms.DragEventArgs) Handles desktopicons.DragOver
|
||||||
|
Dim lvi As ListViewItem = CType(e.Data.GetData("System.Windows.Forms.ListViewItem"), ListViewItem)
|
||||||
|
Dim Offset As Size = Size.Subtract(Cursor.Size, New Size(Cursor.HotSpot.X, Cursor.HotSpot.Y))
|
||||||
|
lvi.Position = Point.Subtract(desktopicons.PointToClient(New Point(e.X, e.Y)), Offset)
|
||||||
|
e.Effect = DragDropEffects.Move
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
Loading…
Reference in a new issue