Dim d As Decimalĭ = Decimal.Round(chkSize, 2, MidpointRounding.AwayFromZero) My.(filePath).LengthĬhkSize = chkSize / 1024 ' THIS IS WHAT I USED TO ROUND THE SIZE TO 2 DECIMAL POINTS. ' THIS IS THE ONLY METHOD THAT I KNOW HOW TO CALCULATE THE FILE SIZE. ' I'M STILL LEARNING SO PLEASE DON'T CRITISIZE ME TO BAD. ' NOW THIS IS WHAT SHOULD TAKE PLACE FOR THE APP TO ADD THE TEXT FILE ' PATHS TO THE LIST VIEW ITEMS If e.Data.GetDataPresent(DataFormats.FileDrop) Then Dim filePaths As String() = CType(e.Data.GetData_ Private Sub lstFiles_DragDrop( ByVal sender As Object, _īyVal e As ) Handles lstFiles.DragDrop Below are examples of the first and second subs that I used to create the drag and drop feature. This is where you want to specify what you want to do with the DataFormat that was copied. Second: You will need to have a Private Sub Method that is: " DragDrop". You can choose whatever best fits with the type of application that you are designing. You also need to choose what kind of effect you want the drag and drop feature to do. There are really only two things that are needed to create a drag and drop feature.įirst: You need to have a Private Sub Method that is: " DragEnter" and choose what kind of DataFormat you wish to use. I hope this example helps some of the VB.NET developers. Well this is just a pretty straightforward example of how to create a drag and drop feature that can list the file paths of the files that were dragged into the listview.
0 Comments
Leave a Reply. |