根据文本框的背景色(RGB)来决定水平滚动条的位置应该怎样写代码呢?
解决方案 »
- vb中怎样将字符串中的字符一个一个的保存到字符串数组中?
- 不支持连接表达式
- 用vb编写了一个显示杨辉三角的程序,却怎么也调试不出,请高手指点。
- CreateProcess获得进程的句柄用其它什么API还可以同样获取??急
- webbrowser的WebBrowser1_DocumentComplete 问题
- OCX 注册问题
- jpg压缩算法
- 请教,VB调用VC生成的DLL问题
- 如何制作出的html help文件安装在客户机上
- 用CreateObject()方法创建一个注册控件的对象,如何知道这个控件被引用的名字?
- 为什么treeview在用的时候提示我:imgelist在使用以前必须初始化?怎么解决呀??
- 用MediaPlayer循环播放的问题
strTmp = Hex$(StrInput)
strTmp1 = strTmp
If Len(strTmp) < 6 Then
For n = 1 To (6 - Len(strTmp))
strTmp1 = strTmp1 & "0"
Next n
End If
strHex1 = Left(strTmp1, 2)
strHex2 = Right(strTmp1, 2)
strHex3 = Mid(strTmp1, 3, 2)
convVbToWeb = strHex2 & strHex3 & strHex1
End FunctionPrivate Function convWebToVB(ByVal StrInput As String) As String
strTmp1 = StrInput
strHex1 = Left(strTmp1, 2)
strHex2 = Right(strTmp1, 2)
strHex3 = Mid(strTmp1, 3, 2)
strTmp = strHex2 & strHex3 & strHex1
convWebToVB = CDec("&H" & strTmp)
End Function这是以前做的一个将VB的颜色代码转为WEB的颜色代码的函数
其实也就是十六进制和十进制的转换,你试一下,很容易分别找到RGB的值的.
例如WEB的颜色表示:#FFCC00其中FF,CC,00就分别为R,G,B的值
Dim CC As Long, CCR As Long, CCG As Long, CCB As Long
CC = Text3.BackColor
CCB = CC \ (256 ^ 2)
bluescr1.Value = CCB
CCG = (CC - CCB * 256 * 256) \ 256
greenscr1.Value = CCG
CCR = CC - CCB * 256 * 256 - CCG * 256
redscr1.Value = CCR