Access交流中心

北京 | 上海 | 天津 | 重庆 | 广州 | 深圳 | 珠海 | 汕头 | 佛山 | 中山 | 东莞 | 南京 | 苏州 | 无锡 | 常州 | 南通 | 扬州 | 徐州 | 杭州 | 温州 | 宁波 | 台州 | 福州 | 厦门 | 泉州 | 龙岩 | 合肥 | 芜湖 | 成都 | 遂宁 | 长沙 | 株洲 | 湘潭 | 武汉 | 南昌 | 济南 | 青岛 | 烟台 | 潍坊 | 淄博 | 济宁 | 太原 | 郑州 | 石家庄 | 保定 | 唐山 | 西安 | 大连 | 沈阳 | 长春 | 昆明 | 兰州 | 哈尔滨 | 佳木斯 | 南宁 | 桂林 | 海口 | 贵阳 | 西宁 | 乌鲁木齐 | 包头 |

谁有颜色转换函数,将16位色改为RGB的值函数

流星  发表于:2016-03-26 16:53:35  
复制

如把#696BFF转换为6908927的函数

 

Top
杜超 发表于:2016-03-28 10:15:13
access版颜色取值小工具[Access软件网]
http://www.accessoft.com/article-show.asp?id=5988

小刘 发表于:2016-04-23 16:20:12

自己写的凑和用吧

Public Function ApplyTheme(Object As Object)

    On Error Resume Next
    Dim HexRGB As String
    If Object Is Nothing Then Exit Function
    
    HexRGB = GetParameter("Theme Color", dbText, "")
    If HexRGB = "" Then
        HexRGB = "EDEDED"
    ElseIf Left(HexRGB, 1) = "#" Then
        HexRGB = Mid(HexRGB, 2)
    Else
        HexRGB = hex(HexRGB)
    End If
    'HexRGB = Mid(GetParameter("Theme Color", dbText, "#EDEDED"), 2)
    
    Select Case Len(HexRGB)
        Case Is > 6
            Err.Raise 6
            'GoTo Error_MyHexidecimal_BeforeUpdate
        Case 1
            HexRGB = "00000" & HexRGB
         Case 2
            HexRGB = "0000" & HexRGB
        Case 3
            HexRGB = "000" & HexRGB
        Case 4
            HexRGB = "00" & HexRGB
        Case 5
            HexRGB = "0" & HexRGB
    End Select
    strBackColor = Val("&H" & HexRGB & "&")
    
    Object.Section(acDetail).Properties("BackColor") = strBackColor
    If Object.Section(acHeader).Visible Then Object.Section(acHeader).Properties("BackColor") = strBackColor
    If Object.Section(acFooter).Visible Then Object.Section(acFooter).Properties("BackColor") = strBackColor
    If Object.Section(acPageHeader).Visible Then Object.Section(acPageHeader).Properties("BackColor") = strBackColor
    If Object.Section(acPageFooter).Visible Then Object.Section(acPageFooter).Properties("BackColor") = strBackColor


End Function


总记录:2篇  页次:1/1 9 1 :