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

goodsun1 2005-03-21 05:51:22
请问:如何弹出windows的调色板
...全文
110 6 打赏 收藏 转发到动态 举报
AI 作业
写回复
用AI写文章
6 条回复
切换为时间正序
请发表友善的回复…
发表回复
slhuang 2005-03-21
  • 打赏
  • 举报
回复
楼上的插入的是OCX的吧。
不过好象不完全。
upshania 2005-03-21
  • 打赏
  • 举报
回复
<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>
rickjelly2004 2005-03-21
  • 打赏
  • 举报
回复
在设计时提供一个 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 Sub

End 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 Sub

End Class
wq2000 2005-03-21
  • 打赏
  • 举报
回复
up
DeltaCat 2005-03-21
  • 打赏
  • 举报
回复
除非你用 客户端 控件
DeltaCat 2005-03-21
  • 打赏
  • 举报
回复
?
什么意思?
在 ASP.NET 里?

不可能吧

62,243

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术交流专区
javascript云原生 企业社区
社区管理员
  • ASP.NET
  • .Net开发者社区
  • R小R
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

.NET 社区是一个围绕开源 .NET 的开放、热情、创新、包容的技术社区。社区致力于为广大 .NET 爱好者提供一个良好的知识共享、协同互助的 .NET 技术交流环境。我们尊重不同意见,支持健康理性的辩论和互动,反对歧视和攻击。

希望和大家一起共同营造一个活跃、友好的社区氛围。

试试用AI创作助手写篇文章吧