比如我有三个text,分别为text1,text2,text3
我想将所选择的颜色的值(红,绿,蓝)分别赋给text1,text2,text3
即:
text1.text="red"
text2.text="green"
text3.text="blue"这个"red","green","blue"
的值是存放在哪里的啊?

解决方案 »

  1.   

    "red","green","blue"
    ----------
    这哪叫颜色值啊,这叫颜色名称了
    你要从CommonDialog选择的 颜色数值来分析,得出颜色名称。
    如果只有这3个情况倒好办,if判断3次。
    如果要识别出每种颜色,那可够折腾的。
      

  2.   

    怎么有这样的值?你只能枚举一下Private Sub Command1_Click()
        cdl.ShowColor
        
        Select Case cdl.Color
            Case vbGreen
                Text1.Text = "Green"
            Case vbRed
                Text1.Text = "Red"
            Case vbBlue
                Text1.Text = "Blue"
        End Select
    End Sub
      

  3.   

    不好意思,我表达错了
    text1.text="xxx"
    text2.text="xxx"
    text3.text="xxx"
    其中xxx为数字,大小为0--255
    请问怎么实现啊
      

  4.   

    Private Sub Command1_Click()
        cdl.ShowColor
        Text1.Text = cdl.Color Mod 256
        Text2.Text = (cdl.Color Mod 65536) \ 256
        Text3.Text = cdl.Color \ 65536
    End Sub