用vb.net程序的问题 按钮使用的问题
操作方法
- 01
建立窗体如图1;当单击“请选择”按钮后,显出文本框,两个单项按钮可以使用;选项某个单选按钮后,图片框和文本框显示相应的内容。 Public Class Form1 Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load T1.Visible = False RadioButton1.Enabled = False RadioButton2.Enabled = False End Sub Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click T1.Visible = True RadioButton1.Enabled = True RadioButton2.Enabled = True End Sub Private Sub RadioButton1_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton1.CheckedChanged T1.Text = "我选择的是美女 " P1.BackgroundImage = Image.FromFile("C:Documents and SettingsAdministrator桌面-6.jpg") P1.BackgroundImageLayout = ImageLayout.Zoom End Sub Private Sub RadioButton2_CheckedChanged(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles RadioButton2.CheckedChanged T1.Text = "我选择的是帅哥 " P1.BackgroundImage = Image.FromFile("C:Documents and SettingsAdministrator桌面.jpg") P1.BackgroundImageLayout = ImageLayout.Zoom End SubEnd Class