如何在vb.net中使用colordialogue控制shockwaveflash对象BGColor

时间:2010-04-01 17:26:19

标签: vb.net

我有以下代码

Private Sub select_color_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles select_color.Click
        Dim ocolor As New ColorDialog
        ocolor.ShowDialog()


        Me.BackColor = ocolor.Color

    End Sub

并将表格的背景颜色更改为我在colordialogue中选择的颜色......

现在我想以这种方式更改shockwaveobject的BGColor ...但是我可以在工具箱中手动更改冲击波对象的BGColor但我想通过颜色对话更改它我该怎么做...

1 个答案:

答案 0 :(得分:1)

您需要将颜色转换为字符串:

    Dim ocolor As New ColorDialog
    If ocolor.ShowDialog() = Windows.Forms.DialogResult.OK Then
            Me.SwfObject.BGColor = ocolor.Color.R.ToString("X2") & ocolor.Color.G.ToString("X2") & ocolor.Color.B.ToString("X2")
    End If