Showing posts with label folder. Show all posts
Showing posts with label folder. Show all posts

Sunday, 22 July 2012

special folders in vb.net

In this tutorial, we cover using the special folders to retrieve the path of a special folder on a machine. when you want open folder as default folder like my documents, downloads etc.

Copy and paste below Code:

Public Class Form1

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        Dim thepath As String = Environment.GetFolderPath(Environment.SpecialFolder.MyDocuments)

        Process.Start(thepath & "\image.jpg")
    End Sub

End Class

Sunday, 12 February 2012

How to use open file,color,folder,font dialog box in vb.net?


How to download file in vb.net?
In this tutorial you can learn how to use  open file dialog box , color dialog box, font dialog, folder browser dialog from tool box  using vb.net
Step1:
Open Microsoft visual studio 2010
Step2:
Open file newà windows  forms applicationà rename as all in one
Step3:
Form1

Drag and drop open file dialog box , color dialog box, font dialog, folder browser dialog from tool box and four buttons



Step3:
Write or copy the below code to form1.vb
Public Class Form1

    Private SubButton1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton1.Click
        Dim Open As New OpenFileDialog
        If Open.ShowDialog = Windows.Forms.DialogResult.OK Then

        End If
    End Sub
    Private SubButton2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton2.Click
        Dim color As New ColorDialog
        If color.ShowDialog = Windows.Forms.DialogResult.OK Then

        End If
    End Sub

    Private SubButton3_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton3.Click
        Dim folder As New FolderBrowserDialog
        If folder.ShowDialog = Windows.Forms.DialogResult.OK Then

        End If
    End Sub

    Private SubButton4_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) HandlesButton4.Click
        Dim font As New FontDialog
        If font.ShowDialog = Windows.Forms.DialogResult.OK Then

        End If


    End Sub
End Class


Output: