Wrox Programmer Forums
|
Beginning VB 6 For coders who are new to Visual Basic, working in VB version 6 (not .NET).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Beginning VB 6 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 4th, 2006, 07:03 PM
Registered User
 
Join Date: Jan 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default using ColorTranslator

I am trying to use the Common Dialog Color box to pick a color and then return it's HTML value on a MS Access form. Right now I just want a MsgBox with the color value.

Code:
Private Sub Command1_Click()
 With CommonDialog
  .DialogTitle = "Pick a color"
  .ShowColor
  Dim htmlColor As String
'  htmlColor = System.Drawing.ColorTranslator.ToHtml(.Color)
  MsgBox "Color is " & System.Drawing.ColorTranslator.ToHtml(.Color)

End With
End Sub
I can pick the color then I get a 424 error Object required. I am a total noobie and I know the problem is somewhere on the MsgBox line.

TIA
Caleb










Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.