[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 255
  • Last Modified:

VB 2005: ColorDialog, FontDialog

How does one use these dialogs?

When the user has made there selection, how and where is it held?

Thanks in advance...
0
Murray Brown
Asked:
Murray Brown
  • 2
  • 2
2 Solutions
 
gbzhhuCommented:
http://www.experts-exchange.com/Programming/Q_21811989.html

the solution is in C#  let me know if you have problem converting it to VB
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Hi

Thanks for that, but I need it in visual basic.
0
 
gbzhhuCommented:
Here for the color dialog

        Dim ColorDialog1 As ColorDialog = New ColorDialog
        ColorDialog1.AllowFullOpen = True
        ColorDialog1.FullOpen = True
        ColorDialog1.ShowHelp = True
        'Set the initial color select to the current text color,
        'so that if the user cancels out we will restore the original color.
        ColorDialog1.Color = Color.DarkBlue
        ColorDialog1.ShowDialog()
        Dim clr As System.Drawing.Color = ColorDialog1.Color
        MessageBox.Show(clr.ToString())

0
 
Mike TomlinsonMiddle School Assistant TeacherCommented:
Simple as...

    Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
        If ColorDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            Me.BackColor = ColorDialog1.Color
        End If
    End Sub

    Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
        If FontDialog1.ShowDialog = Windows.Forms.DialogResult.OK Then
            Me.Font = FontDialog1.Font
        End If
    End Sub
0
 
Murray BrownMicrosoft Cloud Azure/Excel Solution DeveloperAuthor Commented:
Thanks very much gbxhhu. Idle Mind, thanks very much for the simplification!
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

  • 2
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now