窗体设计界面如下:
My.Resources.Resource1.WindowString1
具体代码如下:
调用字符串资源:
Dim resstringIndex As Integer Private Sub Button1_Click(sender As Object,e As EventArgs) Handles Button1.Click Select Case resstringIndex Case 1 TextBox1.Text = My.Resources.Resource1.WindowString1 resstringIndex = 2 Case 2 TextBox1.Text = My.Resources.Resource1.WindowString2 resstringIndex = 3 Case 3 TextBox1.Text = My.Resources.Resource1.WindowString3 resstringIndex = 1 End Select End Sub Private Sub Form1_Load(sender As Object,e As EventArgs) Handles MyBase.Load resstringIndex = 1 End Sub
Private Sub Button2_Click(sender As Object,e As EventArgs) Handles Button2.Click PictureBox1.Image = My.Resources.Resource1.BoldB PictureBox2.Image = My.Resources.Resource1.Redob PictureBox3.Image = My.Resources.Resource1.Undob End Sub
Private Sub Button3_Click(sender As Object,e As EventArgs) Handles Button3.Click TextBox2.Text = My.Resources.Resource1.bbb End Sub
运行后效果如下:
由于.net平台下C#和vb.NET很相似,本文也可以为C#爱好者提供参考。
学习更多vb.net知识,请参看vb.net 教程 目录
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。