Re: [VB6 ] 請問CommonDialog控制項內的ShowColor

看板Visual_Basic作者 (喵喵叫的蜜蜂貓)時間19年前 (2006/05/06 12:11), 編輯推噓0(000)
留言0則, 0人參與, 最新討論串2/3 (看更多)
※ 引述《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
文章代碼(AID): #14N27Ygw (Visual_Basic)
文章代碼(AID): #14N27Ygw (Visual_Basic)