请问:如何弹出windows的调色板

解决方案 »

  1.   

    ?
    什么意思?
    在 ASP.NET 里?不可能吧
      

  2.   

    在设计时提供一个 HTML 颜色字符串生成器,供用户选择颜色使用。
    有关此类型所有成员的列表,请参阅 ColorBuilder 成员。
    System.Object
       System.Web.UI.Design.ColorBuilder
    [Visual Basic]
    NotInheritable Public Class ColorBuilder
    [C#]
    public sealed class ColorBuilder
    [C++]
    public __gc __sealed class ColorBuilder
    [JScript]
    public class ColorBuilder
    线程安全
    此类型的所有公共静态(Visual Basic 中为 Shared)成员对多线程操作而言都是安全的。但不保证任何实例成员是线程安全的。
    备注
    BuildColor 方法启动用于选择颜色值的用户界面。ColorBuilder 类不能在设计时环境外使用。ColorBuilder 需要 IWebFormsBuilderUIService(通常可在设计时在 Web 窗体项目中获得)。如果要生成 HTML 颜色字符串,可能需要实现一个方法,将 Color 对象的 RGB 值转换为与 HTML 兼容的 RRGGBB 格式字符串。如果打算使用控件来选择颜色或配置颜色,则可以为此生成一个用户界面,或者可以使用 PropertyGrid 控件,通过该控件使用默认的、具有颜色选择界面的 ColorEditor 来编辑 Color 属性。
    示例
    [Visual Basic] 
    ' Create a parent control.
    Dim c As New System.Windows.Forms.Control()
    c.CreateControl()' Launch the Color Builder using the specified control 
    ' parent and an initial HTML format ("RRGGBB") color string.
    System.Web.UI.Design.ColorBuilder.BuildColor(Me.Component, c, "405599")
    [C#] 
    // Create a parent control.
    System.Windows.Forms.Control c = new System.Windows.Forms.Control();            
    c.CreateControl();            // Launch the Color Builder using the specified control 
    // parent and an initial HTML format ("RRGGBB") color string.
    System.Web.UI.Design.ColorBuilder.BuildColor(this.Component, c, "405599");
    [C++] 
    // Create a parent control.
    System::Windows::Forms::Control* c = new System::Windows::Forms::Control();
    c->CreateControl();// Launch the Color Builder using the specified control
    // parent and an initial HTML format (S"RRGGBB") color String*.
    System::Web::UI::Design::ColorBuilder::BuildColor(this->Component, c, S"405599");
    [Visual Basic] 
    ' Example designer provides a designer verb menu command to launch the 
    ' BuildColor method of the ColorBuilder.
    Public Class ColorBuilderDesigner
        Inherits System.Web.UI.Design.UserControlDesigner    Public Sub New()
        End Sub    ' Provides a designer verb menu command for invoking the BuildColor 
        ' method of the ColorBuilder.
        Public Overrides ReadOnly Property Verbs() As System.ComponentModel.Design.DesignerVerbCollection
            Get
                Dim dvc As New DesignerVerbCollection()
                dvc.Add(New DesignerVerb("Launch Color Builder UI", New EventHandler(AddressOf Me.launchColorBuilder)))
                Return dvc
            End Get
        End Property    ' This method handles the "Launch Color Builder UI" menu command.
        ' Invokes the BuildColor method of the System.Web.UI.Design.ColorBuilder.
        Private Sub launchColorBuilder(ByVal sender As Object, ByVal e As EventArgs)
            ' Create a parent control.
            Dim c As New System.Windows.Forms.Control()
            c.CreateControl()        ' Launch the Color Builder using the specified control 
            ' parent and an initial HTML format ("RRGGBB") color string.
            System.Web.UI.Design.ColorBuilder.BuildColor(Me.Component, c, "405599")
        End SubEnd Class' Example web control displays the value of its text property.
    ' This control is associated with the ColorBuilderDesigner.
    <DesignerAttribute(GetType(ColorBuilderDesigner), GetType(IDesigner))> _
    Public Class ColorBuilderControl
        Inherits System.Web.UI.WebControls.WebControl
        Private [text_] As String    <Bindable(True), Category("Appearance"), DefaultValue("")> _
        Public Property [Text]() As String
            Get
                Return [text_]
            End Get        Set(ByVal Value As String)
                [text_] = Value
            End Set
        End Property    Protected Overrides Sub Render(ByVal output As HtmlTextWriter)
            output.Write([Text])
        End SubEnd Class
      

  3.   

    <html>
    <head>
    <title>choose your color</title>
    <script>
    function callcolor()
    {
       var myresult;
       myresult = dlghelper.choosecolordlg()
       document.bgcolor = myresult
    alert(myresult);
    }
    </script>
    </head>
    <body>
    <object id=dlghelper width="0px" height="0px" 
         classid="clsid:3050f819-98b5-11cf-bb82-00aa00bdce0b">
    </object> 
    <button onclick="callcolor()">use color dialog</button>
    </body>
    </html>
      

  4.   

    楼上的插入的是OCX的吧。
    不过好象不完全。