Posts

Showing posts from March, 2018

Using OpenFileDialog to select both folder and file.

Download Source Download application Introduction Hi, guys as you all know that VB.net don't give you any built-in dialog which you can use in scenarios where you want to select or fetch both files and folders in a single showDialog() at the click of a button.Now, this has been a dream for many of the programmers who use VB.NET in most of their projects.Me too stumbled upon such a situation where in my application I needed my application to fetch the path of both a file and a folder using a single showDailog at the click of a button and as you guys know that VB.Net provides different dialogs for both of these.So after putting a lot of research and thinking into it I came up with an effective workaround which allows us to select both file and a folder using OpenFileDialog. Logic Now the basic logic that I applied is to turn the name validation of OpenFileDialog to false then turn file exists to false by default then turn path exists to true and then set a special keywor...

VB.Net block of code to create a borderless dragable window/form for VB.net application.

Image
Code: 'make sure you write this entire block of code outside all methods inside your class Private IsFormBeingDragged As Boolean = False     Private MouseDownX As Integer     Private MouseDownY As Integer     Private Sub Form1_MouseDown(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseDown         If e.Button = MouseButtons.Left Then             IsFormBeingDragged = True             MouseDownX = e.X             MouseDownY = e.Y         End If     End Sub     Private Sub Form1_MouseUp(ByVal sender As Object, ByVal e As MouseEventArgs) Handles MyBase.MouseUp         If e.Button = MouseButtons.Left Then             IsFormBeingDragged = False         End If     End Sub     Priv...