网创优客建站品牌官网
为成都网站建设公司企业提供高品质网站建设
热线:028-86922220
成都专业网站建设公司

定制建站费用3500元

符合中小企业对网站设计、功能常规化式的企业展示型网站建设

成都品牌网站建设

品牌网站建设费用6000元

本套餐主要针对企业品牌型网站、中高端设计、前端互动体验...

成都商城网站建设

商城网站建设费用8000元

商城网站建设因基本功能的需求不同费用上面也有很大的差别...

成都微信网站建设

手机微信网站建站3000元

手机微信网站开发、微信官网、微信商城网站...

建站知识

当前位置:首页 > 建站知识

关于vb.net输出色块的信息

VB.NET文本框颜色变不了,为什么最后LBLNo1的背景色始终是绿色和红色 点击它的第一时间不应该是白色吗?

你没有写刷新功能嘛,如LblResult.BackColor = Color.LightCoral后面再加一句LblResult.refresh()就实现了背景色变换!

专注于为中小企业提供网站建设、成都网站制作服务,电脑端+手机端+微信端的三站合一,更高效的管理,为中小企业翼城免费做网站提供优质的服务。我们立足成都,凝聚了一批互联网行业人才,有力地推动了超过千家企业的稳健成长,帮助中小企业通过网站建设实现规模扩充和转变。

vb.net拾色器设计,要求:能获取图片任意位置的颜色

VB可使用Point方法来获取图片指定点的颜色。

Point 方法

按照长整数,返回在 Form 或 PictureBox 上所指定磅的红-绿-蓝 (RGB) 颜色。

语法

object.Point(x, y)

'窗体判色代码:

Private Sub Form1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Text1 = X

Text2 = Y

Text3 = Point(X, Y)

Text4 = (Val(Text3) Mod 65536) Mod 256 'Red

Text5 = (Val(Text3) Mod 65536) \ 256 'Green

Text6 = Val(Text3) \ 65536 'Blue

Shape1.FillColor = RGB(Val(Text4), Val(Text5), Val(Text6))

End Sub

'PictureBox判色代码:

Private Sub Picture1_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)

Text1 = X

Text2 = Y

Text3 = Picture1.Point(X, Y)

Text4 = (Val(Text3) Mod 65536) Mod 256 'Red

Text5 = (Val(Text3) Mod 65536) \ 256 'Green

Text6 = Val(Text3) \ 65536 'Blue

Shape1.FillColor = RGB(Val(Text4), Val(Text5), Val(Text6))

End Sub

VBNET怎么获取控件颜色的RGB值,又怎么用RGB将颜色赋给控件颜色。

R/G/B值最小是0最大是255属Byte值类型

Dim cr As Color = 控件.BackColor '获取控件背景色

Dim alpha As Byte = cr.A '透明度

Dim R As Byte = cr.R 'R值

Dim G As Byte = cr.G 'G值

Dim B As Byte = cr.B 'B值

Dim outAcr As Color = Color.FromArgb(alpha, R, G, B) '创建带有透明通道的ARGB颜色

Dim outcr As Color = Color.FromArgb(R, G, B) '创建不透明的RGB颜色

在vb.net中,如何获取Graphics中某一指定点(像素)的颜色值?(VB语言)

要使用GetPixel函数来取得像素的颜色值,代码如下:

1

2

3

4

5

private void button1_Click(object sender, EventArgs e)

{

Color color = new Bitmap(pictureBox1.Image).GetPixel(10, 10);

MessageBox.Show(color.ToString());

VB.NET如何显示多种颜色的一段文本?

Label控件是没有办法实现多种颜色的文字的,只能用RichTextBox来实现,而且你的自定义格式字符串也没有结尾的,这样很不好,至少也要red红色字/redyellow黄色字/yellow,而且实现也很麻烦的,下面的代码我没有检测正确性,有错误的自己改一改吧

Dim colortag() as string

dim colors() as color

const txt as string="red红色字/redyellow黄色字/yellow"

private sub Form_Load(object sender,eventargs e)handles mybase.load

colortag(0)="red":Colortag(1)="yellow"

colors(0)=color.red:colors(1)=color.yellow

richtextbox1.text=txt

for i as integer=0 to colortag.lenght-1

dim tag as string="" colortag(i) ""

dim endtag as string="/" colortag(i) ""

dim find as integer=1

do

find=instr(find,txt,tag)+tag.lenght

if(find0)then

dim find1 as integer=instr(find,txt,endtag)

richtextbox1.SelectionStart=find

richtextbox1.selectionlenght=find1-find

richtextbox1.selectioncolor=colors(i)

find=find1

else

exit do

end if

loop

next

end sub


当前标题:关于vb.net输出色块的信息
分享地址:http://bjjierui.cn/article/hesjip.html

其他资讯