Re: [VB6 ] 請問CommonDialog控制項內的ShowColor
※ 引述《winstonlim (wayne)》之銘言:
: 請問各位大大...
: CommonDialog 控制項內的ShowColor
: 由於我想在我選好一種顏色後
: 而要讓Text1.Text上顯示ShowColor的RGB值,如(255,155,200)
: 該如何抓它的值呢?
: Private Sub Command1_Click()
: CommonDialog1.flags = 2
: CommonDialog1.ShowColor
: Text1.BackColor = CommonDialog1.Color
: End Sub
: 拜託各位大大了...
如果是系統顏色的話,要先用
Declare Function GetSysColor Lib "user32.dll" (ByVal nIndex As Long) As Long
去抓值
出來的Long值用16進位表示就是bbggrr
用"\"跟"/"兩個運算子就可以求出原來的RGB值了
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 140.115.207.65
討論串 (同標題文章)
Visual_Basic 近期熱門文章
PTT數位生活區 即時熱門文章