十年网站开发经验 + 多家企业客户 + 靠谱的建站团队
量身定制 + 运营维护+专业推广+无忧售后,网站问题一站解决
在VB6中可以通过设置对象的Font属性设置字体字号,ForeColor属性设置字体颜色。\x0d\x0a例如,下面代码实现设置文本框中的字体为”隶书“字号28磅,字体颜色为红色\x0d\x0aPrivate Sub Command1_Click()\x0d\x0aText1.Font.Size = 28\x0d\x0aText1.Font.Name = "隶书"\x0d\x0aText1.ForeColor = vbRed\x0d\x0aEnd Sub
创新互联专注于峡江网站建设服务及定制,我们拥有丰富的企业做网站经验。 热诚为您提供峡江营销型网站建设,峡江网站制作、峡江网页设计、峡江网站官网定制、重庆小程序开发公司服务,打造峡江网络公司原创品牌,更为您提供峡江网站排名全网营销落地服务。
1、2和3:你怎么改的,就怎么恢复默认
3:textbox1.font=new font(字体名称,字体大小,字形),字形有加粗常规倾斜下划线等几种。
也容易,如果是黑白三个颜色加上相同的渐变量,彩色的是起始颜色的三个分量与终止颜色的对应三个分量的差值,再除于相同的份数,就得出三原色各自的步进量。
窗体上放个图片框试试下面代码:
Private Sub PictureBox1_Paint(ByVal sender As Object, ByVal e As System.Windows.Forms.PaintEventArgs) Handles PictureBox1.Paint
Dim startColor As Color = Color.Red
Dim endColor As Color = Color.Green
Dim s As String = "vb.net 如何使文字能渐变颜色,就是颜色慢慢变淡然后在慢慢恢复?"
Dim Steps As Integer = s.Length \ 2
Dim StepR As Integer = (CInt(endColor.R) - startColor.R) \ Steps
Dim StepG As Integer = (CInt(endColor.G) - startColor.G) \ Steps
Dim StepB As Integer = (CInt(endColor.B) - startColor.B) \ Steps
Dim R As Integer = startColor.R
Dim G As Integer = startColor.G
Dim B As Integer = startColor.B
Dim drawFont As New System.Drawing.Font("Arial", 16)
Dim X As Integer = 50
For i As Integer = 1 To Steps
Dim drawBrush As New SolidBrush(Color.FromArgb(R, G, B))
e.Graphics.DrawString(s.Substring(i - 1, 1), drawFont, drawBrush, X, 50.0)
X += 18
R += StepR
G += StepG
B += StepB
Next
For i As Integer = 1 To Steps
Dim drawBrush As New SolidBrush(Color.FromArgb(R, G, B))
e.Graphics.DrawString(s.Substring(i + Steps - 1, 1), drawFont, drawBrush, X, 50.0)
X += 18
R -= StepR
G -= StepG
B -= StepB
Next
End Sub
1、2和3:你怎么改的,就怎么恢复默认
3:textbox1.font=new
font(
字体
名称,字体大小,
字形
),字形有加粗常规倾斜
下划线
等几种。