This code sample shows how to get selected font and color through font dialog object in vb.net :
Continue reading “Get selected Font and Font Color through Font Dialog”
Tag: dialogs
Get selected folder from Folder Browser Dialog using vb.net
Following example code demonstrate how to get selected path from folder browser dialog in vb.net.
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim SelectedPath As String = GetSelectedPath() End Sub
Private Function GetSelectedPath() As String Dim objDlg As New FolderBrowserDialog Dim SelectedPath As String = "" 'Set The Folderbrowserdialog Control Properties objDlg.Description = "Select Your Folder" objDlg.RootFolder = Environment.SpecialFolder.MyDocuments objDlg.ShowNewFolderButton = True If objDlg.ShowDialog = Windows.Forms.DialogResult.OK Then SelectedPath = objDlg.SelectedPath End If 'Clean Up objDlg.Dispose() objDlg = Nothing Return SelectedPath End Function
Add color option in Font Dialog in vb.net
Following example shows how to add color option in font dialog using vb.net
Continue reading “Add color option in Font Dialog in vb.net”
Display windows form as dialog in vb.net
In this example we will learn that how to use showdialog
method in vb.net to display a windows form. When we use this method then form will be open as dialog.
Continue reading “Display windows form as dialog in vb.net”
Add custom colors to color dialog in vb.net
Following example add some custom colors into colordialog using vb.net like this:
Continue reading “Add custom colors to color dialog in vb.net”
Code snippet : how to use fontdialog in vb.net
How to use fontdialog in vb.net
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim objFontDlg As New FontDialog If objFontDlg.ShowDialog = Windows.Forms.DialogResult.OK Then Label1.Font = objFontDlg.Font TextBox1.Font = objFontDlg.Font End If End Sub
How to use ColorDialog in vb.net
The following example shows the usage of the colordialog class in vb.net.
Continue reading “How to use ColorDialog in vb.net”
savefiledialog in vb.net
Following example shows how to use savefiledialog for selecting the path for saving the file in vb.net.
Private Sub Button1_Click(ByVal sender As System.Object, _ ByVal e As System.EventArgs) Handles Button1.Click Dim objDlg As SaveFileDialog = New SaveFileDialog() Dim objDlgResult As DialogResult = objDlg.ShowDialog() If objDlgResult = Windows.Forms.DialogResult.OK Then 'write your code End If End Sub
How to set description in FolderBrowserDialog
You can get or sets the description above the tree view control in the dialog box. like this
Continue reading “How to set description in FolderBrowserDialog”