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:

No comments:

Post a Comment